import os import multiprocessing import time import subprocess class ZeroServerWizardManager: def __init__(self): pass #def init def end_operations(self): os.system("/usr/sbin/upstart-manager disable network-manager") os.system("stop network-manager") os.system("/etc/init.d/networking restart") os.system("/etc/init.d/dnsmasq restart") os.system("update-alternatives --install /usr/share/lliurex-firefox-settings/lliurex-firefox.properties lliurex-firefox /usr/share/lliurex-firefox-settings/lliurex-firefox-client.properties 90") os.system("zero-center set-configured zero-server-wizard") p=multiprocessing.Process(target=self._t_restart) p.start() return True #def end_operations def get_samba_id(self): try: pprocess = subprocess.Popen(['net','getlocalsid'],stderr=subprocess.PIPE,stdout=subprocess.PIPE) sambaid = pprocess.communicate()[0] aux = sambaid.split(":")[1] id=aux[1:len(aux)-1] return id except: return None #def get_samba_id def _t_restart(self): time.sleep(1) os.system("kill -9 $(cat /tmp/.n4d_pid)") #class ZeroServerWizardManager