dhcp: failing to find a supported impl should be a fatal error

This commit is contained in:
Ariadne Conill 2020-07-25 03:09:41 -06:00
parent 00c1d0f58c
commit 38af1ce2d2

View file

@ -6,7 +6,8 @@ determine_implementation() {
[ -x /sbin/dhcpcd ] && echo "dhcpcd" && return
[ -x /usr/sbin/dhclient ] && echo "dhclient" && return
[ -x /sbin/udhcpc ] && echo "udhcpc" && return
echo "???"
echo "could not find a supported DHCP implementation"
exit 1
}
start() {
@ -24,8 +25,7 @@ start() {
/sbin/udhcpc -b -R -p /var/run/udhcpc.$IFACE.pid -i $IFACE
;;
*)
echo "implementation $1 not supported"
exit 1
;;
esac
}
@ -41,8 +41,7 @@ stop() {
kill $(cat /var/run/udhcpc.$IFACE.pid)
;;
*)
echo "implementation $1 not supported"
exit 1
;;
esac
}