4
# Required-Start: $local_fs $remote_fs
5
# Required-Stop: $local_fs $remote_fs
6
# Should-Start: mysql postgresql $syslog
7
# Should-Stop: mysql postgresql $syslog
8
# Default-Start: 2 3 4 5
10
# Short-Description: Gammu SMS daemon
11
# Description: Daemon for automatically sending and receiving messages using GSM phone.
14
PATH=/sbin:/bin:/usr/sbin:/usr/bin
15
DAEMON=/usr/bin/gammu-smsd
17
DESC="Gammu SMS Daemon"
19
# user which will run this daemon
22
# Gracefully exit if the package has been removed.
23
test -x $DAEMON || exit 0
25
# Include user parameters if available
26
if [ -f /etc/default/$NAME ] ; then
30
. /lib/lsb/init-functions
34
if grep -q '^port = /dev/null' /etc/gammu-smsdrc ; then
35
log_warning_msg " $NAME not yet configured, please edit /etc/gammu-smsdrc"
38
log_daemon_msg "Starting $DESC" "$NAME"
39
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
40
--exec $DAEMON -- $DAEMON_OPTS --daemon --user $USER \
41
--pid /var/run/$NAME.pid
45
log_daemon_msg "Stopping $DESC" $NAME
46
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
56
log_daemon_msg "Reloading $DESC" $NAME
57
start-stop-daemon --stop --signal HUP --quiet --pidfile \
58
/var/run/$NAME.pid --name $NAME
62
status_of_proc -p /var/run/$NAME.pid $DAEMON $NAME && exit 0 || exit $?
66
echo "Usage: $N {start|stop|restart|force-reload|reload|status}" >&2