3 if [ "$(whoami)" != "root" ]; then
4 echo "You must be root to start/restart/stop services."
11 DESC
="SMS Server Tools 3"
16 PIDFILE
="/var/run/smsd/smsd.pid"
17 INFOFILE
="/var/run/smsd/smsd.working"
18 LOGFILE
="/var/log/smsd/smsd.log"
20 [ -r "/etc/conf.d/smsd" ] && .
/etc
/conf.d
/smsd
22 PID
=`cat $PIDFILE 2>/dev/null`
26 stat_busy
"Starting $DESC"
27 [ -n "$USER" ] && PARAMS
="-u$USER $PARAMS"
28 [ -n "$GROUP" ] && PARAMS
="-g$GROUP $PARAMS"
29 [ -n "$LOGFILE" ] && PARAMS
="-l$LOGFILE $PARAMS"
30 if [ -z "$PID" ]; then
31 /usr
/bin
/smsd
-n MAINPROCESS
-p$PIDFILE -i$INFOFILE $PARAMS
33 PID
=`cat $PIDFILE 2>/dev/null`
34 if [ -z "$PID" ]; then exit 1; fi
38 echo -n "Already running!"
43 stat_busy
"Stopping $DESC"
44 [ -n "$PID" ] && kill $PID &>/dev
/null
46 echo -n "Not started!"
58 echo "usage: $0 {start|stop|restart}"