File: wanpipe_monitor

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 (37 lines) | stat: -rw-r--r-- 933 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
#!/usr/bin/ksh
#
# start keep_alive script for wan
#
# modification history:
#
# tm    980203  initial  release
# tm    980227  added start/stop functionality
###################################################################             
prog=$(basename $0)
LOG=/var/log/wan_monitor
MONITOR=/usr/local/bin/wan_keep_alive

case "$1" in
   start)
       print "$prog:  starting wan monitoring keep_alive..."
       savelog -c 7 ${LOG}
       if [ -x $MONITOR ] ; then
          $MONITOR >${LOG} 2>&1 &
       else
          print "couldn't locate $MONITOR"
       fi
       ;;
    stop)
       print "$prog:  stoping wan monitoring keep_alive..."
       KILLPID=$(pidof -x $(basename $MONITOR))
       if [ -n $KILLPID ] ; then
          kill $KILLPID
       fi
       ;;
    *)
       echo "Usage: $prog {start|stop}" >&2
       exit 1
    ;;
esac                                                                            

exit 0