Remove .acl files
authorAndy Bavier <acb@cs.princeton.edu>
Tue, 15 Apr 2008 18:34:40 +0000 (18:34 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Tue, 15 Apr 2008 18:34:40 +0000 (18:34 +0000)
factory/setup-link

index be8c949..ba8cb42 100755 (executable)
@@ -37,6 +37,7 @@ iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
 
 ### Create "grab link" script
 GRAB=/vsys/grab-$ETUN0
+rm -f $GRAB $GRAB.acl
 cat > $GRAB <<EOF
 #!/bin/sh
 
@@ -45,13 +46,17 @@ read PID
 chcontext --ctx 1 -- echo \$PID > /sys/class/net/$ETUN0/new_ns_pid 
 EOF
 chmod +x $GRAB
+sleep 1
 echo $SLICE > $GRAB.acl 
 
 ### Create "delete link" script
 DELETE=/vsys/delete-$ETUN0
+rm -f $DELETE $DELETE.acl
 cat > $DELETE <<EOF
 #!/bin/sh
 
+read NULL
+
 # Remove iptables rule
 iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID
 
@@ -66,11 +71,12 @@ brctl delbr $BRIDGE
 ip tunnel del $EGRE
 
 # Clean up files
-rm $GRAB
-rm $DELETE
+rm -f $GRAB $GRAB.acl
+rm -f $DELETE $DELETE.acl
 
 EOF
 chmod +x $DELETE
+sleep 1
 echo $SLICE > $DELETE.acl