|
Other /
Vuse init.d Control ScriptOther.Vuse HistoryHide minor edits - Show changes to markup February 13, 2010, at 06:51 PM
by -
Changed lines 10-136 from:
to:
RCSCRIPT=/usr/bin/rcvuse test -x $RCSCRIPT || ln -fs /etc/init.d/vuse $RCSCRIPT
VUSE_BIN=/opt/azureus/azureus test -r $VUSE_BIN || { echo "$VUSE_BIN not existing"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } VUSE_USER=bob id $VUSE_USER > /dev/null 2> /dev/null || { echo "$VUSE_USER user doesn't exist"; if [ "$1" = "stop" ]; then exit 0; else exit 4; fi; } USER_PARAM= [ `id -u` == 0 ] && USER_PARAM="-u $VUSE_USER " VUSE_OPTIONS='' VUSE_MONITOR_TIMEOUT=2h . /etc/rc.status rc_reset
case "$1" in start)
echo -n "Starting Vuse "
/sbin/startproc $USER_PARAM$VUSE_BIN $VUSE_OPTIONS
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down Vuse "
/sbin/killproc -TERM $VUSE_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
status)
echo -n "Checking for service Vuse "
/sbin/checkproc $VUSE_BIN
# Remember status and be verbose
rc_status -v
;;
monitor)
echo "Starting Monitoring of the Vuse service. Timeout = $VUSE_MONITOR_TIMEOUT"
$0 start-sleep
# Remember status and be quiet
rc_status
;;
start-sleep)
echo "Starting Monitoring of the Vuse service. Timeout = $VUSE_MONITOR_TIMEOUT"
if ! $0 status ; then
$0 start
sleep $VUSE_MONITOR_TIMEOUT && $0 start-sleep &
fi
# Remember status and be quiet
rc_status
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|monitor)"
exit 1
;;
esac rc_exit February 13, 2010, at 06:24 PM
by -
Added lines 1-13:
(:title Vuse init.d Control Script:) Vuse (Azureus) is a bit torrent client. This init.d script allows the user to stop/start the application on boot, but can also start a process where it launches every so often to make sure that the application is running. /etc/init.d/vuse
(:div style="border-style:ridge; border-width:2px; background-color:#ffffcc; margin-left:50px; overflow:auto; width:650px; height:500px;":) (:divend:) |