#! /bin/sh # chkconfig: 2345 60 40 ### BEGIN INIT INFO # Provides: tee-supplicant # Required-Start: $local_fs # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start tee-supplicant at boot time # Description: Enable service provided by tee-supplicant. # X-Start-Before: # X-Stop-After: # X-Timesys-Start-Number: 60 # X-Timesys-Stop-Number: 40 ### END INIT INFO case "$1" in start) echo -n "Starting tee-supplicant: " if pidof tee-supplicant >/dev/null 2>&1; then echo "tee-supplicant is already running" exit 1 fi tee-supplicant & if ! pidof tee-supplicant >/dev/null 2>&1; then echo "[ Failed ]" exit 1 else echo "[ OK ]" fi ;; stop) echo -n "Stopping tee-supplicant: " if pidof tee-supplicant >/dev/null 2>&1 ; then kill $(pidof tee-supplicant) echo "[ OK ]" else echo "Is tee-supplicant running?" exit 1 fi ;; restart|force-reload) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2 ;; esac