Magellan Linux

Annotation of /trunk/remserial/remserial.rc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 497 - (hide annotations) (download)
Fri Feb 22 10:39:06 2008 UTC (16 years, 3 months ago) by niro
File size: 1266 byte(s)
initial package; rc scripts for remserial

1 niro 497 #!/bin/bash
2     # $Header: /root/magellan-cvs/src/remserial/remserial.rc,v 1.1 2008-02-22 10:39:06 niro Exp $
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/sysconfig/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     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     echo -e ${COLOREDSTAR}"Starting remote-serial daemon ..."
33     checkconfig
34     start-stop-daemon --quiet --start --exec /usr/bin/remserial \
35     --pidfile /var/run/remserial.pid --make-pidfile \
36     -- -d -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     echo -e ${COLOREDSTAR}"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     echo "Usage: $0 {start|stop|restart|status}"
64     exit 1
65     ;;
66     esac