config/interface_modify.sh: before calling a script check if it exists and is executable
authorStefan Metzmacher <metze@samba.org>
Mon, 12 Jul 2010 12:05:51 +0000 (14:05 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 15 Jul 2010 05:36:39 +0000 (15:06 +0930)
For non bash shells $_s_script might end with '/*'.

We do the workarround this way, because it makes sense to check
that a script is executable, before trying to execute it.

metze

[ This actually applies to any shell -- Rusty Russell ]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
config/interface_modify.sh

index 738530b4e9eb682b5e4353646cc06c2394a51974..69601ddef71027d484d4a6d52234e2939d198d4e 100755 (executable)
@@ -68,6 +68,9 @@ delete_ip_from_iface()
 
                local _s_script=""
                for _s_script in $_s_script_dir/*; do
+                       test -x "$_s_script" || {
+                               continue
+                       }
                        $_s_script "$_iface" "$_s_ip" "$_s_maskbits" || {
                                ret=$?
                                echo "$_s_script '$_iface' '$_s_ip' '$_s_maskbits' - failed - $ret"