Contents of /trunk/remserial/remserial.rc
Parent Directory | Revision Log
Revision 1321 -
(show annotations)
(download)
Wed May 11 22:29:40 2011 UTC (13 years, 4 months ago) by niro
File size: 1167 byte(s)
Wed May 11 22:29:40 2011 UTC (13 years, 4 months ago) by niro
File size: 1167 byte(s)
-added missing postinstall
1 | #!/bin/bash |
2 | # $Id$ |
3 | |
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 | source /etc/conf.d/rc |
14 | 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 | if [[ -z $(eval echo \$${i}) ]] |
22 | then |
23 | rc_echo "Please set up /etc/conf.d/remserial proberly... aborted" |
24 | exit 1 |
25 | fi |
26 | done |
27 | } |
28 | |
29 | |
30 | case "$1" in |
31 | start) |
32 | rc_print "Starting remote-serial daemon ..." |
33 | checkconfig |
34 | start-stop-daemon --quiet --start --exec /usr/bin/remserial \ |
35 | --pidfile /var/run/remserial.pid --make-pidfile --background \ |
36 | -- -r "${REMOTE_HOST}" -p "${REMOTE_PORT}" -s "${STTY_OPTS}" "${EXTRA_OPTS}" "${DEVICE}" |
37 | evaluate_retval |
38 | |
39 | update_svcstatus $1 |
40 | splash svc_started "$(basename $0)" 0 |
41 | ;; |
42 | |
43 | stop) |
44 | rc_print "Stopping remote-serial daemon ..." |
45 | 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 | rc_echo "Usage: $0 {start|stop|restart|status}" |
64 | exit 1 |
65 | ;; |
66 | esac |