This file is indexed.

/etc/init.d/gsm-utils is in gsm-utils 1.10+20120414.gita5e5ae9a-0.3+b1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#! /bin/sh
### BEGIN INIT INFO
# Provides:          gsm-utils
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO
#
# /etc/init.d/gsm-utils: Controls the GSM SMS send daemon
#
# written by Matthias Goebl <matthias@goebl.net>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/gsmsmsd
NAME=gsmsmsd
DEFAULTFILE=/etc/default/gsm-utils
DESC="GSM SMS send daemon"

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

PHONEDEV=/dev/mobilephone  # or /dev/ttyS0 or /dev/ircomm0
BAUDRATE=9600
PIN=""  # or 1234
SMSPROCESSOR=""  # or /usr/bin/gsmsmsprocessor
SPOOLDIR=/var/spool/sms
PRIORITIES=3
STARTOPTS=""
SMSUSER="gsmsms:gsmsms"
test -r /etc/default/gsm-utils && . /etc/default/gsm-utils  # for overwriting some parameters

if [ "$RUNGSMSMS" != "yes" ];then
        echo "GSM SMS deamon not yet configured. Edit /etc/default/gsm-utils first."
        exit 0
fi

OPTIONS="-d $PHONEDEV -b $BAUDRATE -L -P $PRIORITIES"
OPTIONS="$OPTIONS -s $SPOOLDIR/queue -S $SPOOLDIR/sent -F $SPOOLDIR/failed"
test -n "$SMSPROCESSOR" && OPTIONS="$OPTIONS -a $SMSPROCESSOR"
test -n "$SMSUSER" && STARTOPTS="$STARTOPTS --chuid $SMSUSER"
test -r /etc/default/gsm-utils && . /etc/default/gsm-utils  # for overwriting OPTIONS

if [ ! -d /run/gsm-utils ] ; then
    mkdir -p /run/gsm-utils || true
    if [ -d /run/gsm-utils ] ; then
        test -n "$SMSUSER" && chown -R gsmsms:gsmsms /run/gsm-utils
    fi
fi


case "$1" in
  start)
	echo -n "Starting $DESC: "
	if [ -n "$PIN" ];then
		echo -n "entering PIN.. "
		(
		# This is ugly.. But if the PIN is already entered, the ME returns
		# "ERROR" and makes gsmctl retrying..
		/usr/bin/gsmctl -d $PHONEDEV -b $BAUDRATE -I "+cpin=$PIN" &
		PID=$!
		sleep 3
		kill $PID 2>/dev/null
		) >/dev/null 2>&1
	fi
	echo -n "$NAME"
	start-stop-daemon --start --quiet --pidfile /run/gsm-utils/$NAME.pid \
		--make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS
	echo "."
	;;
  stop)
	echo -n "Stopping $DESC: $NAME "
	start-stop-daemon --stop --quiet --pidfile /run/gsm-utils/$NAME.pid \
		--exec $DAEMON
	sleep 5
	echo "."
	;;
  restart|force-reload)
	echo -n "Restarting $DESC: $NAME"
	start-stop-daemon --stop --quiet --pidfile /run/gsm-utils/$NAME.pid \
		--make-pidfile --exec $DAEMON -- $OPTIONS
	sleep 5
	start-stop-daemon --start --quiet --pidfile /run/gsm-utils/$NAME.pid \
		--make-pidfile --background $STARTOPTS --exec $DAEMON -- $OPTIONS
	echo "."
	;;
  *)
	N=/etc/init.d/gsm-utils
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0