Annotation of /trunk/remserial/remserial.rc
Parent Directory | Revision Log
Revision 1321 -
(hide annotations)
(download)
Wed May 11 22:29:40 2011 UTC (13 years, 5 months ago) by niro
File size: 1167 byte(s)
Wed May 11 22:29:40 2011 UTC (13 years, 5 months ago) by niro
File size: 1167 byte(s)
-added missing postinstall
1 | niro | 497 | #!/bin/bash |
2 | niro | 1321 | # $Id$ |
3 | niro | 497 | |
4 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k | ||
5 | #%start: 90 | ||
6 | #%stop: 20 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | niro | 1321 | source /etc/conf.d/rc |
14 | niro | 497 | source $rc_functions |
15 | source /etc/conf.d/remserial | ||
16 | |||
17 | checkconfig() | ||
18 | { | ||
19 | for i in REMOTE_HOST REMOTE_PORT STTY_OPTS DEVICE | ||
20 | do | ||
21 | niro | 498 | if [[ -z $(eval echo \$${i}) ]] |
22 | niro | 497 | then |
23 | niro | 1321 | rc_echo "Please set up /etc/conf.d/remserial proberly... aborted" |
24 | niro | 497 | exit 1 |
25 | fi | ||
26 | done | ||
27 | } | ||
28 | |||
29 | |||
30 | case "$1" in | ||
31 | start) | ||
32 | niro | 1321 | rc_print "Starting remote-serial daemon ..." |
33 | niro | 497 | checkconfig |
34 | start-stop-daemon --quiet --start --exec /usr/bin/remserial \ | ||
35 | niro | 498 | --pidfile /var/run/remserial.pid --make-pidfile --background \ |
36 | -- -r "${REMOTE_HOST}" -p "${REMOTE_PORT}" -s "${STTY_OPTS}" "${EXTRA_OPTS}" "${DEVICE}" | ||
37 | niro | 497 | evaluate_retval |
38 | |||
39 | update_svcstatus $1 | ||
40 | splash svc_started "$(basename $0)" 0 | ||
41 | ;; | ||
42 | |||
43 | stop) | ||
44 | niro | 1321 | rc_print "Stopping remote-serial daemon ..." |
45 | niro | 497 | start-stop-daemon --quiet --stop --pidfile /var/run/remserial.pid |
46 | evaluate_retval | ||
47 | |||
48 | update_svcstatus $1 | ||
49 | splash svc_stopped "$(basename $0)" 0 | ||
50 | ;; | ||
51 | |||
52 | restart) | ||
53 | $0 stop | ||
54 | sleep 1 | ||
55 | $0 start | ||
56 | ;; | ||
57 | |||
58 | status) | ||
59 | statusproc /usr/bin/remserial | ||
60 | ;; | ||
61 | |||
62 | *) | ||
63 | niro | 1321 | rc_echo "Usage: $0 {start|stop|restart|status}" |
64 | niro | 497 | exit 1 |
65 | ;; | ||
66 | esac |