239c3e3199a9fc1dd78feac077731a41ca51bfc8
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / smstools3 / S50smsd
1 #!/bin/sh
2 #
3 # Starts the SMS Server Tools 3
4 #
5
6 NAME=smsd
7 DAEMON=/usr/bin/$NAME
8 PIDFILE=/var/run/$NAME.pid
9 SPOOL=/var/spool/sms
10
11 start()
12 {
13         echo -n "Starting $NAME: "
14         mkdir -p $SPOOL/outgoing
15         mkdir -p $SPOOL/incoming
16         mkdir -p $SPOOL/checked
17         start-stop-daemon -S -q -p $PIDFILE --exec $DAEMON -- -c /etc/smsd.conf && echo "OK" || echo "Failed"
18 }
19
20 stop()
21 {
22         echo -n "Stopping $NAME: "
23         start-stop-daemon -K -q -p $PIDFILE && echo "OK" || echo "Failed"
24         rm -f $PIDFILE
25 }
26
27 case "$1" in
28         start)
29                 start
30                 ;;
31         stop)
32                 stop
33                 ;;
34         restart|reload)
35                 stop
36                 start
37                 ;;
38         *)
39                 echo "Usage: $0 {start|stop|restart}"
40                 exit 1
41 esac
42
43 exit $?