2005-04-25 10:17:48 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# PROVIDE: instiki
|
|
|
|
# REQUIRE: DAEMON
|
|
|
|
#
|
2006-04-15 18:29:22 +02:00
|
|
|
# Add the following line to /etc/rc.conf[.local] to enable instiki:
|
2005-04-25 10:17:48 +02:00
|
|
|
# instiki_enable (bool): Set to "NO" by default
|
|
|
|
# Set it to "YES" to enable instiki
|
2006-05-01 16:32:28 +02:00
|
|
|
# instiki_flags (str): Set to "--port %%INSTIKIPORT%% --daemon" by default.
|
2005-04-25 10:17:48 +02:00
|
|
|
# Extra flags passed to start command
|
|
|
|
#
|
2006-04-15 18:29:22 +02:00
|
|
|
|
2010-03-27 01:15:24 +01:00
|
|
|
. /etc/rc.subr
|
2005-04-25 10:17:48 +02:00
|
|
|
|
|
|
|
name="instiki"
|
2006-04-15 18:29:22 +02:00
|
|
|
rcvar=${name}_enable
|
2008-02-24 00:40:03 +01:00
|
|
|
start_cmd="${name}_start"
|
|
|
|
status_cmd="${name}_status"
|
|
|
|
stop_cmd="${name}_stop"
|
2006-04-15 18:29:22 +02:00
|
|
|
|
|
|
|
#rcvar=`set_rcvar`
|
2005-04-25 10:17:48 +02:00
|
|
|
|
2010-01-06 14:24:46 +01:00
|
|
|
command="%%WWWDIR%%/instiki.rb"
|
|
|
|
#command_interpreter="/usr/bin/env"
|
2005-04-25 10:17:48 +02:00
|
|
|
|
2006-05-01 16:32:28 +02:00
|
|
|
: ${instiki_enable="NO"}
|
|
|
|
: ${instiki_flags="--port %%INSTIKIPORT%% --daemon"}
|
2005-04-25 10:17:48 +02:00
|
|
|
|
2008-02-24 00:40:03 +01:00
|
|
|
instiki_pid=$(ps x | grep "ruby $command" | grep -v grep | awk '{ print $1 }' )
|
2006-06-09 10:58:56 +02:00
|
|
|
sig_stop=KILL
|
2005-04-25 10:17:48 +02:00
|
|
|
|
2008-02-24 00:40:03 +01:00
|
|
|
instiki_start()
|
|
|
|
{
|
|
|
|
unset "start_cmd"
|
|
|
|
test -n "$instiki_pid" || run_rc_command start
|
|
|
|
}
|
|
|
|
|
|
|
|
instiki_status()
|
|
|
|
{
|
|
|
|
if [ -n "$instiki_pid" ] ; then
|
|
|
|
echo "Instiki is running at pid: $instiki_pid"
|
|
|
|
else
|
|
|
|
echo "Instiki is not running."
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
instiki_stop()
|
|
|
|
{
|
|
|
|
test -n "$instiki_pid" && kill -$sig_stop $instiki_pid
|
|
|
|
}
|
2006-05-01 16:32:28 +02:00
|
|
|
|
2008-02-24 00:40:03 +01:00
|
|
|
load_rc_config $name
|
2006-05-01 16:32:28 +02:00
|
|
|
run_rc_command "$1"
|