aboutsummaryrefslogtreecommitdiff
path: root/etc/pccard_ether
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>1999-09-13 15:44:20 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>1999-09-13 15:44:20 +0000
commit321704296f6ba1a5885ff7064b14fbeecf20c340 (patch)
tree920fd19901d5e07524b525646b51b9635f1686a7 /etc/pccard_ether
parent4a086b52ca9b3fe330755fcf9e1c7a9c657927ee (diff)
downloadsrc-321704296f6ba1a5885ff7064b14fbeecf20c340.tar.gz
src-321704296f6ba1a5885ff7064b14fbeecf20c340.zip
Apply a consistent style to most of the etc scripts. Particularly, use
case instead of test where appropriate, since case allows case is a sh builtin and (as a side-effect) allows case-insensitivity. Changes discussed on freebsd-hackers. Submitted by: Doug Barton <Doug@gorean.org>
Notes
Notes: svn path=/head/; revision=51231
Diffstat (limited to 'etc/pccard_ether')
-rwxr-xr-xetc/pccard_ether55
1 files changed, 32 insertions, 23 deletions
diff --git a/etc/pccard_ether b/etc/pccard_ether
index e5d3ce1ff0d4..2bc3a192b3a5 100755
--- a/etc/pccard_ether
+++ b/etc/pccard_ether
@@ -8,42 +8,51 @@
#
# Suck in the configuration variables
-if [ -f /etc/defaults/rc.conf ]; then
+#
+if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
-elif [ -f /etc/rc.conf ]; then
+elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi
-if [ "${pccard_ifconfig}" != "NO" ] ; then
- if [ "${pccard_ifconfig}" = "DHCP" ] ; then
- if [ -f /sbin/dhclient ] ; then
- if [ -s /var/run/dhclient.pid ] ; then
+case ${pccard_ifconfig} in
+[Nn][Oo] | '')
+ ;;
+[Dd][Hh][Cc][Pp])
+ if [ -r /sbin/dhclient ]; then
+ if [ -s /var/run/dhclient.pid ]; then
kill `cat /var/run/dhclient.pid`
rm /var/run/dhclient.pid
- fi
- /sbin/dhclient
- elif [ -f /usr/local/sbin/dhcpc ] ; then
- if [ -s /var/run/dhcpc.pid ] ; then
- kill `cat /var/run/dhcpc.pid`
- rm /var/run/dhcpc.pid
- fi
- /usr/local/sbin/dhcpc $*
- else
- echo "DHCP client software not available (isc-dhcp2)"
fi
+ /sbin/dhclient
+ elif [ -r /usr/local/sbin/dhcpc ]; then
+ if [ -s /var/run/dhcpc.pid ]; then
+ kill `cat /var/run/dhcpc.pid`
+ rm /var/run/dhcpc.pid
+ fi
+ /usr/local/sbin/dhcpc $*
else
- interface=$1
- shift
- ifconfig ${interface} ${pccard_ifconfig} $*
+ echo "DHCP client software not available (isc-dhcp2)"
fi
-fi
+ ;;
+*)
+ interface=$1
+ shift
+ ifconfig ${interface} ${pccard_ifconfig} $*
+ ;;
+esac
-if [ "${defaultrouter}" != "NO" ] ; then
+case ${defaultrouter} in
+[Nn][Oo] | '')
+ ;;
+*)
static_routes="default ${static_routes}"
route_default="default ${defaultrouter}"
-fi
-
+ ;;
+esac
+
# Set up any static routes.
+#
if [ -n "${static_routes}" ]; then
# flush beforehand, just in case....
route -n flush