forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrs.inet
More file actions
executable file
·74 lines (64 loc) · 1.29 KB
/
Copy pathrs.inet
File metadata and controls
executable file
·74 lines (64 loc) · 1.29 KB
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
70
71
72
73
#!/bin/sh
# 'Recovery' script that doesn't. This script is to be used for drivers that
# should not be restarted. Instead, the scripts configures the driver 'down'.
kill_by_name()
{
label="$1"
pid=`ps ax | grep "$label" | grep -v grep |
sed 's,[ ]*\([0-9]*\).*,\1,`
if [ X"$pid" = X ]
then
return 1 # No such process
fi
echo "killing pid $pid for $label"
kill -9 $pid
}
daemonize()
{
# Function to start a daemon, if it exists.
local IFS=':'
local name="$1"
test "$1" = tcpd && name="$2"
for dir in $PATH
do
if [ -f "$dir/$1" ]
then
# check if this service is disabled at the boot monitor.
if disabled $name; then return; fi
echo -n " $name"
"$@" &
return
fi
done
}
disabled()
{
ifs="$IFS"; IFS=,
for skip in `sysenv disable`
do
if [ "$skip" = "$1" ]
then
IFS="$ifs"; unset ifs
return 0
fi
done
IFS="$ifs"; unset ifs
return 1
}
exec > /dev/console
echo "Arguments: $@"
service down "$1"
kill_by_name dhcpd
kill_by_name nonamed
kill_by_name syslogd
sleep 3
if [ X`/bin/sysenv lwip` = Xyes ]
then
service up /usr/sbin/lwip -script /etc/rs.inet
dhcpd --lwip &
else
service up /usr/sbin/inet -script /etc/rs.inet
daemonize dhcpd
fi
daemonize nonamed -L
daemonize syslogd