#!/usr/bin/python import socket import hashlib import time ip = "10.0.0.50" port = 12345 s = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) s.connect(( ip, port )) try: while True: s.send( hashlib.sha256( socket.gethostbyname( socket.gethostname() ) ).hexdigest() ) antwort = s.recv( 1024 ) if antwort != hashlib.sha256( ip ).hexdigest(): print "shutting down now..." time.sleep(10) finally: s.close()