Commits

Ivan Vučica  committed 1872d97

Support for on-down.sh script

  • Participants
  • Parent commits d433f4c

Comments (0)

Files changed (1)

File xmpptuntap.py

 						break
 				return	
 
+def onDown():
+	if os.path.isfile("on-down.sh"):
+		os.system("bash ./on-down.sh")
 
 
 jid = xmpp.protocol.JID(config['jid'])
 						continue
 					else:
 					 	print "Connection lost"
-						exit
+						onDown()
+					
+						raise Exception("Connection lost")
 
 				
 			else:
+				onDown()
 				raise Exception("Unknown socket type: %s" % repr(socketlist[each]))
 
 
 	except KeyboardInterrupt:
 		# finish whatever needed
+		onDown()
 		break