diff options
author | Bill Nottingham <notting@redhat.com> | 2009-07-29 17:26:33 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2009-07-30 12:24:33 -0400 |
commit | 1096cd2ebc150e5c74b5e8e4016b835f34cd3f48 (patch) | |
tree | 5581822887866deec1c54bacb72b732589d0e52f /sysconfig/network-scripts/ifdown-eth | |
parent | 48573c2f689c0b7b0aefcb230ce32a7f0fb9d843 (diff) | |
download | initscripts-1096cd2ebc150e5c74b5e8e4016b835f34cd3f48.tar initscripts-1096cd2ebc150e5c74b5e8e4016b835f34cd3f48.tar.gz initscripts-1096cd2ebc150e5c74b5e8e4016b835f34cd3f48.tar.bz2 initscripts-1096cd2ebc150e5c74b5e8e4016b835f34cd3f48.tar.xz initscripts-1096cd2ebc150e5c74b5e8e4016b835f34cd3f48.zip |
Use $() instead of `` for process expansion.
Adapted from <victor.lowther@gmail.com>.
Diffstat (limited to 'sysconfig/network-scripts/ifdown-eth')
-rwxr-xr-x | sysconfig/network-scripts/ifdown-eth | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 62dd354b..f12e3b54 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -33,9 +33,9 @@ check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "boot if [ "${SLAVE}" != "yes" -o -z "${MASTER}" ]; then if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then - FOUNDMACADDR=`get_hwaddr ${REALDEVICE}` + FOUNDMACADDR=$(get_hwaddr ${REALDEVICE}) if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then - NEWCONFIG=`get_config_by_hwaddr ${FOUNDMACADDR}` + NEWCONFIG=$(get_config_by_hwaddr ${FOUNDMACADDR}) if [ -n "${NEWCONFIG}" ]; then eval $(LANG=C fgrep "DEVICE=" $NEWCONFIG) else @@ -53,7 +53,7 @@ fi fi if is_bonding_device ${DEVICE} ; then - for device in `LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*` ; do + for device in $(LANG=C grep -l "^[[:space:]]*MASTER=${DEVICE}" /etc/sysconfig/network-scripts/ifcfg-*) ; do is_ignored_file "$device" && continue /sbin/ifdown ${device##*/} done @@ -64,14 +64,14 @@ fi /etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG} if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -f /var/run/dhcp6c_${DEVICE}.pid ]; then - kill `cat /var/run/dhcp6c_${DEVICE}.pid`; + kill $(cat /var/run/dhcp6c_${DEVICE}.pid); rm -f /var/run/dhcp6c_${DEVICE}.pid; fi retcode=0 -[ -n "`pidof -x dhclient`" ] && { +[ -n "$(pidof -x dhclient)" ] && { if [ -f "/var/run/dhclient-${DEVICE}.pid" ]; then - dhcpid=`cat /var/run/dhclient-${DEVICE}.pid` + dhcpid=$(cat /var/run/dhclient-${DEVICE}.pid) if [[ "$DHCPRELEASE" = [yY1]* ]]; then /sbin/dhclient -r -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1 retcode=$? @@ -112,8 +112,8 @@ if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then /usr/sbin/brctl delif ${BRIDGE} ${DEVICE} # Upon removing a device from a bridge, # it's necessary to make radvd reload its config - [ -r /var/run/radvd/radvd.pid ] && kill -HUP `cat /var/run/radvd/radvd.pid` - if [ -d /sys/class/net/${BRIDGE}/brif ] && [ `ls -1 /sys/class/net/${BRIDGE}/brif | wc -l` -eq 0 ]; then + [ -r /var/run/radvd/radvd.pid ] && kill -HUP $(cat /var/run/radvd/radvd.pid) + if [ -d /sys/class/net/${BRIDGE}/brif ] && [ $(ls -1 /sys/class/net/${BRIDGE}/brif | wc -l) -eq 0 ]; then /usr/sbin/brctl delbr ${BRIDGE} fi fi |