aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2020-07-28 10:44:25 +0200
committerOlav Vitters <olav@vitters.nl>2020-07-28 10:44:25 +0200
commit057113fa55e5731ada1e414c607ba3bc85d676e6 (patch)
tree9559f450c49d958779aa6b2b4ec0f0ab7d68cea7
parent990ac2e3cbaedc3e9a624f975ce4d64f8ea9eee2 (diff)
downloadinitscripts-057113fa55e5731ada1e414c607ba3bc85d676e6.tar
initscripts-057113fa55e5731ada1e414c607ba3bc85d676e6.tar.gz
initscripts-057113fa55e5731ada1e414c607ba3bc85d676e6.tar.bz2
initscripts-057113fa55e5731ada1e414c607ba3bc85d676e6.tar.xz
initscripts-057113fa55e5731ada1e414c607ba3bc85d676e6.zip
ifup-eth: make use of is_true and is_false in our customizations
-rwxr-xr-xnetwork-scripts/ifup-eth24
1 files changed, 12 insertions, 12 deletions
diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth
index ea0ebef8..5562d46c 100755
--- a/network-scripts/ifup-eth
+++ b/network-scripts/ifup-eth
@@ -141,7 +141,7 @@ IS_WIRELESS=
if is_wireless_device ${DEVICE}; then
# ralink devices need to be up for wireless-tools to work
ip link set dev ${DEVICE} up
- if [ -n "${daemon}" -o "$MII_NOT_SUPPORTED" = "yes" ]; then
+ if [ -n "${daemon}" ] || is_true "$MII_NOT_SUPPORTED" ; then
# try to trigger association (and always load wireless settings)
WIRELESS_CONFIG="wireless.d/$WIRELESS_ESSID"
[ -f "$WIRELESS_CONFIG" ] && source "$WIRELESS_CONFIG"
@@ -154,7 +154,7 @@ if is_wireless_device ${DEVICE}; then
-c /etc/wpa_supplicant.conf \
-D ${WIRELESS_WPA_DRIVER}
fi
- if [ "$WIRELESS_WPA_REASSOCIATE" = "yes" ]; then
+ if is_true "$WIRELESS_WPA_REASSOCIATE"; then
sleep 2
wpa_cli reassociate
fi
@@ -268,7 +268,7 @@ if [ -n "${BRIDGE}" ]; then
fi
# exec ifplugd daemon at boot if supported
-if [ -n "${daemon}" -a "$MII_NOT_SUPPORTED" != "yes" ]; then
+if [ -n "${daemon}" ] && ! is_true "$MII_NOT_SUPPORTED"; then
IFPLUGD_ARGS="${IFPLUGD_ARGS=-I -b}"
exec /sbin/ifplugd $IFPLUGD_ARGS -i $DEVICE
fi
@@ -309,16 +309,16 @@ case $(basename $DHCP_CLIENT) in
dhcpcd)
DHCP_ARGS="--waitip"
[ -n "${DHCP_HOSTNAME}" ] && DHCP_ARGS="${DHCP_ARGS} -h ${DHCP_HOSTNAME}"
- [ "${PEERDNS}" = "no" ] && DHCP_ARGS="${DHCP_ARGS} -C resolv.conf"
- [ "${PEERGATEWAY}" = "no" ] && DHCP_ARGS="${DHCP_ARGS} -G"
+ is_false "${PEERDNS}" && DHCP_ARGS="${DHCP_ARGS} -C resolv.conf"
+ is_false "${PEERGATEWAY}" && DHCP_ARGS="${DHCP_ARGS} -G"
[ -n "${DHCP_TIMEOUT}" ] && DHCP_ARGS="${DHCP_ARGS} -t ${DHCP_TIMEOUT}"
- [ "${NEEDHOSTNAME}" = "no" ] && DHCP_ARGS="${DHCP_ARGS} -C lookup-hostname"
- if [ "${PEERNTPD}" = "yes" ]; then
+ is_false "${NEEDHOSTNAME}" && DHCP_ARGS="${DHCP_ARGS} -C lookup-hostname"
+ if is_true "${PEERNTPD}"; then
DHCP_ARGS="${DHCP_ARGS} -o ntp_servers"
else
DHCP_ARGS="${DHCP_ARGS} -C ntp.conf -O ntp_servers"
fi
- if [ "${PEERYP}" = "yes" ]; then
+ if is_true "${PEERYP}"; then
DHCP_ARGS="${DHCP_ARGS} -o nis_domain -o nis_servers"
else
DHCP_ARGS="${DHCP_ARGS} -C yp.conf -C ypbind -O nis_domain -O nis_servers"
@@ -337,9 +337,9 @@ case $(basename $DHCP_CLIENT) in
;;
pump)
[ -n "$DHCP_HOSTNAME" ] && DHCP_ARGS="-h $DHCP_HOSTNAME"
- [ "${NEEDHOSTNAME}" = "yes" ] && DHCP_ARGS="$DHCP_ARGS --lookup-hostname"
- [ "${PEERDNS}" = "no" ] && DHCP_ARGS="$DHCP_ARGS -d"
- [ "${PEERGATEWAY}" = "no" ] && DHCP_ARGS="$DHCP_ARGS --no-gateway"
+ is_true "${NEEDHOSTNAME}" && DHCP_ARGS="$DHCP_ARGS --lookup-hostname"
+ is_false "${PEERDNS}" && DHCP_ARGS="$DHCP_ARGS -d"
+ is_false "${PEERGATEWAY}" && DHCP_ARGS="$DHCP_ARGS --no-gateway"
DHCP_ARGS="$DHCP_ARGS -i $DEVICE"
;;
dhcpxd)
@@ -348,7 +348,7 @@ case $(basename $DHCP_CLIENT) in
DHCP_ARGS="$DHCP_ARGS --wait $DEVICE"
;;
dhclient)
- if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then
+ if is_true "${PERSISTENT_DHCLIENT}"; then
ONESHOT=
else
ONESHOT="-1"