forked from ya-jeks/gsmmux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mux.d
executable file
·71 lines (64 loc) · 1.18 KB
/
mux.d
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
#!/bin/bash
#
# Sample startup script for the gsmMuxd
#
# chkconfig: 2345 94 11
# description: gsmMuxd is serial line multiplexer
#
# processname: gsmMuxd
# Source function library.
. /etc/init.d/functions
# Path to mobilegw binary, and short-form for messages
gsmMuxExe=/usr/sbin/gsmMuxd
executable=gsmMuxd
prog=gsmMuxd
RETVAL=0
OPTIONS="-p /dev/ttyUSB0 -w -r -s /dev/mux /dev/ptmx /dev/ptmx /dev/ptmx"
# Functions
start() {
# See if it's already running.
pid=`pidofproc $executable`
if [ -n "$pid" ] && ps h $pid >/dev/null 2>&1; then
echo -n "Starting gsmMux"
echo_failure
echo
return
fi
action "Starting gsmMux " $gsmMuxExe $OPTIONS
RETVAL=$?
touch /var/lock/subsys/gsmMuxd0
echo
return $RETVAL
}
stop() {
echo -n "Stopping gsmMux"
killproc $gsmMuxExe
RETVAL=$?
rm -f /var/lock/sybsys/gsmMuxd0
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $gsmMuxExe
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
stop
start
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL