wok diff phpvirtualbox/stuff/etc/init.d/vboxwebsrv @ rev 15481

Add memtester
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 10 15:03:57 2013 +0000 (2013-11-10)
parents
children 7f188676b59c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/phpvirtualbox/stuff/etc/init.d/vboxwebsrv	Sun Nov 10 15:03:57 2013 +0000
     1.3 @@ -0,0 +1,59 @@
     1.4 +#!/bin/sh
     1.5 +# Start, stop and restart vboxwebsrv deamon on SliTaz, at boot time or 
     1.6 +# with the command line.
     1.7 +#
     1.8 +# To start daemon at boot time, just put vboxwebsrv in the $RUN_DAEMONS
     1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    1.10 +#
    1.11 +. /etc/init.d/rc.functions
    1.12 +
    1.13 +NAME=$(basename $0)
    1.14 +DESC="$NAME deamon"
    1.15 +DAEMON=$(which $NAME)
    1.16 +OPTIONS="-b --logfile /dev/null"
    1.17 +eval $(grep -i ^${NAME}_OPTIONS /etc/daemons.conf | sed 's/.*_OPT/OPT/')
    1.18 +PIDFILE=/var/run/$NAME.pid
    1.19 +
    1.20 +case "$1" in
    1.21 +  start)
    1.22 +    if active_pidfile $PIDFILE $NAME ; then
    1.23 +      echo "$NAME is already running."
    1.24 +      exit 1
    1.25 +    fi
    1.26 +    echo -n "Starting $DESC: $NAME... "
    1.27 +    $DAEMON $OPTIONS > /dev/null 2>&1
    1.28 +    [ -f $PIDFILE ] || pidof $NAME | awk '{ print $1 }' > $PIDFILE
    1.29 +    active_pidfile $PIDFILE $NAME
    1.30 +    status
    1.31 +    ;;
    1.32 +  stop)
    1.33 +    if ! active_pidfile $PIDFILE $NAME ; then
    1.34 +      echo "$NAME is not running."
    1.35 +      exit 1
    1.36 +    fi
    1.37 +    echo -n "Stopping $DESC: $NAME... "
    1.38 +    kill `cat $PIDFILE`
    1.39 +    status
    1.40 +    ;;
    1.41 +  restart)
    1.42 +    if ! active_pidfile $PIDFILE $NAME ; then
    1.43 +      echo "$NAME is not running."
    1.44 +      exit 1
    1.45 +    fi
    1.46 +    echo -n "Restarting $DESC: $NAME... "
    1.47 +    kill `cat $PIDFILE`
    1.48 +    sleep 2
    1.49 +    $DAEMON $OPTIONS > /dev/null 2>&1
    1.50 +    [ -f $PIDFILE ] || pidof $NAME | awk '{ print $1 }' > $PIDFILE
    1.51 +    active_pidfile $PIDFILE $NAME
    1.52 +    status
    1.53 +    ;;
    1.54 +*)
    1.55 +    echo ""
    1.56 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.57 +    echo ""
    1.58 +    exit 1
    1.59 +    ;;
    1.60 +esac
    1.61 +
    1.62 +exit 0