Serious refactoring of TUN/TAP and tunnel code. Linux udp/gre tunnels not yet functional
[nepi.git] / src / nepi / resources / planetlab / scripts / pl-vif-down.py
index caac65a..8164455 100644 (file)
@@ -70,13 +70,15 @@ if __name__ == '__main__':
     # If a socket name is sent, send the STOP message and wait for a reply
     if socket_name:
         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-        sock.connect(socket_name)
-        encoded = base64.b64encode(STOP_MSG)
-        sock.send("%s\n" % encoded)
-        reply = sock.recv(1024)
-        reply = base64.b64decode(reply)
-        print reply
-
+        try:
+            sock.connect(socket_name)
+            encoded = base64.b64encode(STOP_MSG)
+            sock.send("%s\n" % encoded)
+            reply = sock.recv(1024)
+            reply = base64.b64decode(reply)
+            print reply
+        except:
+            print "Did not properly shutdown device"
     # If a slicename is provided, use it to remove a GRE device
     elif slicename:
         import pwd