File: wanpipe.init

package info (click to toggle)
wanpipe 2.1.1-2.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,348 kB
  • ctags: 713
  • sloc: ansic: 6,182; sh: 2,522; cpp: 2,488; makefile: 116
file content (69 lines) | stat: -rw-r--r-- 1,722 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Start or stop wanpipe
#
# modification history:
# original:	Robert Leslie <rob@mars.org>
# current:	tony mancill <tmancill@debian.org>
# tm	981215	added calls to wanpipe_routes and wanpipe_monitor
# 19990419/tm	code for bug #35652 (do not shutdown interfaces on upgrade)
######################################################################

test -x /usr/sbin/wanpipe || exit 0

[ -f /var/lock/wanpipe_upgrade ] && {
   echo "$0:  /var/lock/wanpipe_upgrade exists - no action taken!"
   echo "\t(if you receive this message and are not in the middle of"
   echo "\t an upgrade, please log a bug at http://bugs.debian.org)"
   exit 0
} 

case "$1" in
   start)
      /usr/sbin/wanpipe start
      retval=$?
#      if (($retval == 0)) ; then
      [ -x /etc/wanpipe/wanpipe_routes ] && {
         echo "executing /etc/wanpipe/wanpipe_routes start"
         /etc/wanpipe/wanpipe_routes start
      }
      [ -x /etc/wanpipe/wanpipe_monitor ] && {
         echo "executing /etc/wanpipe/wanpipe_monitor start"
         /etc/wanpipe/wanpipe_monitor start
      }
#      fi
   ;;

   stop)
      /usr/sbin/wanpipe stop
      [ -x /etc/wanpipe/wanpipe_routes ] && {
         echo "executing /etc/wanpipe/wanpipe_routes stop"
         /etc/wanpipe/wanpipe_routes stop
      }
      [ -x /etc/wanpipe/wanpipe_monitor ] && {
         echo "executing /etc/wanpipe/wanpipe_monitor stop"
         /etc/wanpipe/wanpipe_monitor stop
      }
   ;;

   restart)
      $0 stop
      $0 start
   ;;
    
   reload)
      echo -n "Reloading wanpipe..."
      $0 restart
   ;;

   force-reload)
      $0 restart
   ;;

   *)
      echo "Usage: /etc/init.d/wanpipe {start|stop|reload|restart}" >&2
      exit 1
   ;;
esac

exit 0