aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-12-12 14:23:04 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-12-12 14:23:04 -0600
commit8bf501aaf2cb60b8ddf1b2fa2d1ba0ef970fb790 (patch)
treef35f1c500c918a95e599eea89929d85fcd7d830f
parent9d05f68b51d7b31634cde30a482ec0e3da3b1c21 (diff)
network: use 'command -v ip' to test for the ip executable
This is an improved test because it doesn't require the ip executable to be in a specific path.
-rw-r--r--init.d/network.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.d/network.in b/init.d/network.in
index 56d3e7b3..fa9f8de0 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -76,7 +76,7 @@ tentative()
case "$RC_UNAME" in
Linux)
- [ -x /sbin/ip ] || [ -x /bin/ip ] || return 1
+ [ -n "$(command -v ip)" ] || return 1
[ -n "$(ip -f inet6 addr show tentative)" ]
;;
*)
@@ -174,7 +174,7 @@ runip()
routeflush()
{
if [ "$RC_UNAME" = Linux ]; then
- if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
+ if [ -n "$(command -v ip)" ]; then
ip route flush scope global
ip route delete default 2>/dev/null
else
@@ -346,7 +346,7 @@ stop()
then
veinfo "$int"
runargs /etc/ifdown."$int" "$downcmd"
- if [ -x /sbin/ip ] || [ -x /bin/ip ]; then
+ if [ -n "$(command -v ip)" ]; then
# We need to do this, otherwise we may
# fail to add things correctly on restart
ip address flush dev "$int" 2>/dev/null