diff options
author | sheldonh <sheldonh@FreeBSD.org> | 1999-09-13 15:44:20 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 1999-09-13 15:44:20 +0000 |
commit | d8a93d30ec0f7b9de2d59dab07ac29c6f7f8f663 (patch) | |
tree | f61d8b7d858e07792674c281853167482e6806c5 /etc/pccard_ether | |
parent | 019fd9cb5fe17ed3ce93a28306ec3009d2a512f7 (diff) | |
download | FreeBSD-src-d8a93d30ec0f7b9de2d59dab07ac29c6f7f8f663.zip FreeBSD-src-d8a93d30ec0f7b9de2d59dab07ac29c6f7f8f663.tar.gz |
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>
Diffstat (limited to 'etc/pccard_ether')
-rwxr-xr-x | etc/pccard_ether | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/etc/pccard_ether b/etc/pccard_ether index e5d3ce1..2bc3a19 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 |