dhcp: failing to find a supported impl should be a fatal error
This commit is contained in:
parent
00c1d0f58c
commit
38af1ce2d2
1 changed files with 4 additions and 5 deletions
|
@ -6,7 +6,8 @@ determine_implementation() {
|
||||||
[ -x /sbin/dhcpcd ] && echo "dhcpcd" && return
|
[ -x /sbin/dhcpcd ] && echo "dhcpcd" && return
|
||||||
[ -x /usr/sbin/dhclient ] && echo "dhclient" && return
|
[ -x /usr/sbin/dhclient ] && echo "dhclient" && return
|
||||||
[ -x /sbin/udhcpc ] && echo "udhcpc" && return
|
[ -x /sbin/udhcpc ] && echo "udhcpc" && return
|
||||||
echo "???"
|
echo "could not find a supported DHCP implementation"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -24,8 +25,7 @@ start() {
|
||||||
/sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE
|
/sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "implementation $1 not supported"
|
;;
|
||||||
exit 1
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,7 @@ stop() {
|
||||||
kill $(cat /var/run/udhcpc.$IFACE.pid)
|
kill $(cat /var/run/udhcpc.$IFACE.pid)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "implementation $1 not supported"
|
;;
|
||||||
exit 1
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue