1 |
#! /bin/bash |
#! /bin/bash |
2 |
|
|
3 |
PIDFILE="/var/run/smsdaemon.pid" |
PIDFILE="/var/run/smsdaemon.pid" |
4 |
|
chmod 666 /dev/ttyUSB0 |
5 |
|
|
6 |
|
|
7 |
function start_d |
function start_d |
8 |
{ |
{ |
9 |
/usr/local/sbin/smsdaemon --daemon |
/usr/local/bin/smsdaemon --daemon |
10 |
} |
} |
11 |
|
|
12 |
function stop_d |
function stop_d |
39 |
fi |
fi |
40 |
} |
} |
41 |
|
|
42 |
|
function reload_d |
43 |
|
{ |
44 |
|
PID=`cat $PIDFILE` |
45 |
|
kill -HUP $PID |
46 |
|
} |
47 |
|
|
48 |
case $1 in |
case $1 in |
49 |
"start") |
"start") |
50 |
start_d |
start_d |
55 |
"status") |
"status") |
56 |
status_d |
status_d |
57 |
;; |
;; |
58 |
|
"reload") |
59 |
|
reload_d |
60 |
|
;; |
61 |
|
"restart") |
62 |
|
stop_d |
63 |
|
sleep 5 |
64 |
|
start_d |
65 |
|
;; |
66 |
*) |
*) |
67 |
echo "Usage $0 [start|stop|status]" |
echo "Usage $0 [start|stop|status|reload|restart]" |
68 |
;; |
;; |
69 |
esac |
esac |