Lines 9-28
Link Here
|
9 |
# up or down. |
9 |
# up or down. |
10 |
# |
10 |
# |
11 |
|
11 |
|
12 |
case "$2" in |
12 |
rc_script=/etc/init.d/net.$1 |
13 |
up) |
|
|
14 |
state=start |
15 |
;; |
16 |
down) |
17 |
state=stop |
18 |
;; |
19 |
*) |
20 |
echo "$0: wrong arguments" |
21 |
echo "Call with <interface> <up|down>" |
22 |
exit 1 |
23 |
;; |
24 |
esac |
25 |
|
13 |
|
26 |
[ -x /etc/init.d/net.$1 ] && /etc/init.d/net.$1 --quiet $state |
14 |
if [ -x ${rc_script} ]; then |
|
|
15 |
case "$2" in |
16 |
up) |
17 |
/sbin/ifconfig $1 down &> /dev/null |
18 |
$rc_script --quiet start || exit $? |
19 |
;; |
20 |
down) |
21 |
$rc_script --quiet stop || exit $? |
22 |
;; |
23 |
*) |
24 |
echo "$0: wrong arguments" |
25 |
echo "Call with <interface> <up|down>" |
26 |
exit 1 |
27 |
;; |
28 |
esac |
29 |
else |
30 |
echo "$0: init script ${rc_script} not found" |
31 |
exit 2 |
32 |
fi |
27 |
|
33 |
|
28 |
exit 0 |
34 |
exit 0 |