start & stop

Could be used as a template in /etc/init.d

#!/bin/sh
# Start/stop the foo system
# /etc/init.d/foo

# 
test -f "/etc/foo.conf" || exit 1

case "$1" in
start)  echo -n "Starting foo"
        ...
        echo "."
        ;;
stop)   echo -n "Stopping foo"
        ...
        echo "."
        ;;
restart) echo -n "Restarting foo"
        ...
        sleep 2
        ...
        echo "."
        ;;
*)      echo "Usage: /etc/init.d/foo start|stop|restart"
        exit 1
        ;;
esac
exit 0
shell/start_stop.txt · Last modified: 2009/04/24 21:24 by tb
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0