Orkaudio startup script
#!/bin/sh
# PROVIDE: orkaudio
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Note:
# Set "orkaudio_enable=yes" in /etc/rc.conf
#
. /etc/rc.subr
name="orkaudio"
rcvar=`set_rcvar`
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
orkaudio_start()
{
if [ ! -f /var/run/${name}.pid ]
then
/usr/local/sbin/${name}
pgrep ${name} > /var/run/${name}.pid
else
echo "It appears ${name} is already running. NOT starting!"
fi
}
orkaudio_stop() {
if [ ! -f /var/run/${name}.pid ]
then
echo "It appears ${name} is not running."
else
echo -n "Stopping services: ${name}"
kill `cat /var/run/${name}.pid`
rm /var/run/${name}.pid
echo "."
fi
}
run_rc_command "$1"
No comments:
Post a Comment