1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/www/instiki/files/instiki.in
Beech Rintoul 437ecf6910 - Update to 0.12.0 [1]
- Fix rc file [1]
- Major Makefile cleanup
- Move install to ${DATADIR}
- Fix pkg-plist (pkg_delete)
- Add pkg-message
- Take maintainership

PR:		ports/120971
Submitted by:	Salvatore Montefusco <sm@brightpebbles.org> [1]
2008-02-23 23:40:03 +00:00

54 lines
1.1 KiB
Bash

#!/bin/sh
#
# PROVIDE: instiki
# REQUIRE: DAEMON
#
# Add the following line to /etc/rc.conf[.local] to enable instiki:
# instiki_enable (bool): Set to "NO" by default
# Set it to "YES" to enable instiki
# instiki_flags (str): Set to "--port %%INSTIKIPORT%% --daemon" by default.
# Extra flags passed to start command
#
. %%RC_SUBR%%
name="instiki"
rcvar=${name}_enable
start_cmd="${name}_start"
status_cmd="${name}_status"
stop_cmd="${name}_stop"
#rcvar=`set_rcvar`
command="%%DATADIR%%/instiki.rb"
command_interpreter="/usr/bin/env"
: ${instiki_enable="NO"}
: ${instiki_flags="--port %%INSTIKIPORT%% --daemon"}
instiki_pid=$(ps x | grep "ruby $command" | grep -v grep | awk '{ print $1 }' )
sig_stop=KILL
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
}
load_rc_config $name
run_rc_command "$1"