make includes fix from trunk
[minix.git] / etc / rs.inet
blob9ebb3af62815e905c98c92a25dd07b8a76b4115f
1 #!/bin/sh
3 # 'Recovery' script that doesn't. This script is to be used for drivers that
4 # should not be restarted. Instead, the scripts configures the driver 'down'.
6 kill_by_name()
8 label="$1"
9 pid=`ps ax | grep "$label" | grep -v grep |
10 sed 's,[ ]*\([0-9]*\).*,\1,`
11 if [ X"$pid" = X ]
12 then
13 return 1 # No such process
15 echo "killing pid $pid for $label"
16 kill -9 $pid
19 daemonize()
21 # Function to start a daemon, if it exists.
22 local IFS=':'
23 local name="$1"
24 test "$1" = tcpd && name="$2"
26 for dir in $PATH
28 if [ -f "$dir/$1" ]
29 then
31 # check if this service is disabled at the boot monitor.
32 if disabled $name; then return; fi
34 echo -n " $name"
35 "$@" &
36 return
38 done
41 disabled()
43 ifs="$IFS"; IFS=,
44 for skip in `sysenv disable`
45 do
46 if [ "$skip" = "$1" ]
47 then
48 IFS="$ifs"; unset ifs
49 return 0
51 done
52 IFS="$ifs"; unset ifs
53 return 1
56 exec > /dev/console
57 echo "Arguments: $@"
59 service down "$1"
60 kill_by_name dhcpd
61 kill_by_name nonamed
62 kill_by_name syslogd
63 sleep 3
64 service up /usr/sbin/inet -script /etc/rs.inet
65 daemonize dhcpd
66 daemonize nonamed -L
67 daemonize syslogd