]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Use eval for ifconfig so that medium can include quoted strings (yuck!)
authorTed Lemon <source@isc.org>
Thu, 15 Mar 2001 23:16:52 +0000 (23:16 +0000)
committerTed Lemon <source@isc.org>
Thu, 15 Mar 2001 23:16:52 +0000 (23:16 +0000)
client/scripts/bsdos
client/scripts/freebsd
client/scripts/netbsd
client/scripts/openbsd
client/scripts/solaris

index 0c38205d0dc4ed25799937d77b4c911a64c61e2c..1f6dede8dc39e8fc45ebf76498d9c5a81b001995 100755 (executable)
@@ -50,8 +50,8 @@ if [ x$alias_subnet_mask != x ]; then
 fi
 
 if [ x$reason = xMEDIUM ]; then
-  ifconfig $interface $medium
-  ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
+  eval "ifconfig $interface $medium"
+  eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
   sleep 1
   exit_with_hooks 0
 fi
@@ -88,7 +88,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
    then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -104,8 +104,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-    ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+    eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
     route add $new_ip_address 127.1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router >/dev/null 2>&1
@@ -133,7 +133,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   if [ x$old_ip_address != x ]; then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -160,8 +160,8 @@ if [ x$reason = xTIMEOUT ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
-  ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+  eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
   sleep 1
   if [ "$new_routers" != "" ]; then
     set $new_routers
@@ -184,7 +184,7 @@ if [ x$reason = xTIMEOUT ]; then
       exit_with_hooks 0
     fi
   fi
-  ifconfig $interface inet -alias $new_ip_address $medium
+  eval "ifconfig $interface inet -alias $new_ip_address $medium"
   for router in $old_routers; do
     route delete default $router >/dev/null 2>&1
   done
index 877c26103515393d6c59dfe8fd385845148c15be..544ac05bb673169c63e8f5539ea923f9ee18ecd3 100755 (executable)
@@ -50,8 +50,8 @@ if [ x$alias_subnet_mask != x ]; then
 fi
 
 if [ x$reason = xMEDIUM ]; then
-  ifconfig $interface $medium
-  ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
+  eval "ifconfig $interface $medium"
+  eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
   sleep 1
   exit_with_hooks 0
 fi
@@ -87,7 +87,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
    then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -103,8 +103,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-    ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+    eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
     route add $new_ip_address 127.1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router >/dev/null 2>&1
@@ -132,7 +132,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   if [ x$old_ip_address != x ]; then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -159,8 +159,8 @@ if [ x$reason = xTIMEOUT ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
-  ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+  eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
   sleep 1
   if [ "$new_routers" != "" ]; then
     set $new_routers
@@ -183,7 +183,7 @@ if [ x$reason = xTIMEOUT ]; then
       exit_with_hooks 0
     fi
   fi
-  ifconfig $interface inet -alias $new_ip_address $medium
+  eval "ifconfig $interface inet -alias $new_ip_address $medium"
   for router in $old_routers; do
     route delete default $router >/dev/null 2>&1
   done
index bb8ffb8c4ec8198e55c75e198f8b73dcbe4a25a8..404b7ac3cfb012643de715b26ad09661dd576059 100755 (executable)
@@ -50,8 +50,8 @@ if [ x$alias_subnet_mask != x ]; then
 fi
 
 if [ x$reason = xMEDIUM ]; then
-  ifconfig $interface $medium
-  ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
+  eval "ifconfig $interface $medium"
+  eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
   sleep 1
   exit_with_hooks 0
 fi
@@ -88,7 +88,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
    then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -104,8 +104,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-    ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+    eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
     route add $new_ip_address 127.1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router >/dev/null 2>&1
@@ -133,7 +133,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   if [ x$old_ip_address != x ]; then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -160,8 +160,8 @@ if [ x$reason = xTIMEOUT ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
-  ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+  eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
   sleep 1
   if [ "$new_routers" != "" ]; then
     set $new_routers
@@ -184,7 +184,7 @@ if [ x$reason = xTIMEOUT ]; then
       exit_with_hooks 0
     fi
   fi
-  ifconfig $interface inet -alias $new_ip_address $medium
+  eval "ifconfig $interface inet -alias $new_ip_address $medium"
   for router in $old_routers; do
     route delete default $router >/dev/null 2>&1
   done
index 0c38205d0dc4ed25799937d77b4c911a64c61e2c..1f6dede8dc39e8fc45ebf76498d9c5a81b001995 100644 (file)
@@ -50,8 +50,8 @@ if [ x$alias_subnet_mask != x ]; then
 fi
 
 if [ x$reason = xMEDIUM ]; then
-  ifconfig $interface $medium
-  ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
+  eval "ifconfig $interface $medium"
+  eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
   sleep 1
   exit_with_hooks 0
 fi
@@ -88,7 +88,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
    then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -104,8 +104,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-    ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+    eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
     route add $new_ip_address 127.1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router >/dev/null 2>&1
@@ -133,7 +133,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   if [ x$old_ip_address != x ]; then
-    ifconfig $interface inet -alias $old_ip_address $medium
+    eval "ifconfig $interface inet -alias $old_ip_address $medium"
     route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
@@ -160,8 +160,8 @@ if [ x$reason = xTIMEOUT ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
-  ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+  eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
   sleep 1
   if [ "$new_routers" != "" ]; then
     set $new_routers
@@ -184,7 +184,7 @@ if [ x$reason = xTIMEOUT ]; then
       exit_with_hooks 0
     fi
   fi
-  ifconfig $interface inet -alias $new_ip_address $medium
+  eval "ifconfig $interface inet -alias $new_ip_address $medium"
   for router in $old_routers; do
     route delete default $router >/dev/null 2>&1
   done
index 117532f6b1c37b1038834dacdb718db6c58d0557..7ad7eaf89e45e11715caa19176752876bb8fe773 100755 (executable)
@@ -52,7 +52,7 @@ relmajor=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'`
 relminor=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'`
 
 if [ x$reason = xMEDIUM ]; then
-  $ifconfig $interface $medium
+  eval "$ifconfig $interface $medium"
   $ifconfig $interface
   sleep 1
   exit_with_hooks 0
@@ -104,8 +104,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
   fi
   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
-    $ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+    eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
     route add $new_ip_address 127.1 1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router 1 >/dev/null 2>&1
@@ -144,8 +144,8 @@ if [ x$reason = xTIMEOUT ]; then
     $ifconfig ${interface}:1 0 down > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
-  $ifconfig $interface inet $new_ip_address $new_netmask_arg \
-                                       $new_broadcast_arg $medium
+  eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \
+                                       $new_broadcast_arg $medium"
   sleep 1
   set $new_routers
   if ping -s -n -I 1 $1 64 1; then