diff options
author | Martin Schwenke <martin@meltin.net> | 2011-06-28 15:17:37 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-08 15:50:44 +1000 |
commit | 3e65cdb565aa6bc8b4379a01d385089452d26a8d (patch) | |
tree | db01b47098573c935344f1ee85b924c13db209d6 | |
parent | 46c908d542601f9098e38c76798b1e90d9a58e48 (diff) | |
download | samba-3e65cdb565aa6bc8b4379a01d385089452d26a8d.tar.gz samba-3e65cdb565aa6bc8b4379a01d385089452d26a8d.tar.xz samba-3e65cdb565aa6bc8b4379a01d385089452d26a8d.zip |
Scripts: remove absolute paths from interface_modify.sh.
The "ip" command is currently run as "/sbin/ip". This makes it
impossible to replace with a stub in unit testing. The functions file
controls $PATH, so we don't need absolute paths.
This replaces the absolute paths...
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 2702592b5911cfa93625e36f4a0d1c4414c0e3e9)
-rwxr-xr-x | ctdb/config/interface_modify.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ctdb/config/interface_modify.sh b/ctdb/config/interface_modify.sh index 27e06ea673..041637650f 100755 --- a/ctdb/config/interface_modify.sh +++ b/ctdb/config/interface_modify.sh @@ -17,11 +17,11 @@ add_ip_to_iface() local _script_dir="$_readd_base/$_ip.$_maskbits" # we make sure the interface is up first - /sbin/ip link set $_iface up || { + ip link set $_iface up || { echo "Failed to bringup interface $_iface" return 1; } - /sbin/ip addr add $_ip/$_maskbits brd + dev $_iface || { + ip addr add $_ip/$_maskbits brd + dev $_iface || { echo "Failed to add $_ip/$_maskbits on dev $_iface" return 1; } @@ -48,19 +48,19 @@ delete_ip_from_iface() # this _very_ annoying behaviour we have to keep a record of the secondaries and re-add # them afterwards. yuck local _secondaries="" - if /sbin/ip addr list dev $_iface primary | grep -q "inet $_ip/$_maskbits " ; then - _secondaries=`/sbin/ip addr list dev $_iface secondary | grep " inet " | awk '{print $2}'` + if ip addr list dev $_iface primary | grep -q "inet $_ip/$_maskbits " ; then + _secondaries=`ip addr list dev $_iface secondary | grep " inet " | awk '{print $2}'` fi local _failed=0 - /sbin/ip addr del $_ip/$_maskbits dev $_iface || _failed=1 + ip addr del $_ip/$_maskbits dev $_iface || _failed=1 [ -z "$_secondaries" ] || { local _i="" for _i in $_secondaries; do - if /sbin/ip addr list dev $_iface | grep -q "inet $_i" ; then + if ip addr list dev $_iface | grep -q "inet $_i" ; then echo "kept secondary $_i on dev $_iface" else echo "re-adding secondary address $_i to dev $_iface" - /sbin/ip addr add $_i brd + dev $_iface || _failed=1 + ip addr add $_i brd + dev $_iface || _failed=1 fi local _s_ip=`echo "$_i" | cut -d '/' -f1` local _s_maskbits=`echo "$_i" | cut -d '/' -f2` |