Commits

Bryan O'Sullivan committed a435eaa

Small fixes.

  • Participants
  • Parent commits d362c58

Comments (0)

Files changed (2)

 run_netplug(char *ifname, char *action)
 {
     pid_t pid = run_netplug_bg(ifname, action);
-    int status;
-    waitpid(pid, &status, WNOHANG);
-    return status;
+    int status, ret;
+
+    if ((ret = waitpid(pid, &status, 0)) == -1) {
+	perror("waitpid");
+	exit(1);
+    }
+    
+    return WIFEXITED(status) ? WEXITSTATUS(status) : -WTERMSIG(status);
 }
 
 
     ;;
 out)
     if [ -x /sbin/ifdown ]; then
-	exec /sbin/ifdown $dev
+	/sbin/ifdown $dev && exec /sbin/ip addr flush $dev
     else
 	echo "Please teach me how to unplug an interface!" 1>&2
 	exit 1
     fi
     ;;
 probe)
-    exec /sbin/ip link set $dev up
+    exec /sbin/ip link set $dev up >/dev/null 2>&1
     ;;
 *)
     echo "I have been called with a funny action of '%s'!" 1>&2