English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/common-nfo/package/broadcom-wl/files/naswatch.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3265 - (show annotations) (download)
Wed Jul 18 12:45:43 2007 UTC (6 years, 7 months ago) by tg
File size: 843 byte(s)
copy trunk/freewrt r3264 into a new branch for making the nfo system
because upgrading the old adk branch would be a hell more work

1 #!/bin/sh
2 # $FreeWRT$
3 #-
4 # This file is part of the FreeWRT project. FreeWRT is copyrighted
5 # material, please see the LICENCE file in the top-level directory
6 # or at http://www.freewrt.org/licence for details.
7 #-
8 #FWINIT 80
9
10 case $1 in
11 args)
12 shift
13 sp=
14 while test $# -gt 0; do
15 printf "$sp'%s'" "$(printf '%s' "$1" | sed "s/'/'\\''/g")"
16 sp=' '
17 shift
18 done
19 printf '\n'
20 exit 0
21 ;;
22 autostart|start) ;;
23 *) exit 0 ;;
24 esac
25
26 sleep 30
27
28 naspid=$(cat /var/run/nas.lan.pid)
29 if test ! "$naspid" -ge 1; then
30 echo No NAS found. | logger -t naswatch
31 exit 1
32 fi
33
34 cmd=$(xargs -0 /bin/sh "$0" args </proc/$naspid/cmdline)
35 case $cmd in
36 *bin/nas*) ;;
37 *)
38 echo Error reading command line. | logger -t naswatch
39 exit 1
40 ;;
41 esac
42
43 while sleep 30; do
44 test -z "$(pidof nas)" || continue
45 echo Restarting NAS. | logger -t naswatch
46 eval "$cmd"
47 done &
48 exit 0

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20