def restart(cls): has_samba = cls.has_installed() if not has_samba: print("Samba has not been installed") return # shell.system("service samba restart") shell.system("service smbd restart") shell.system("service nmbd restart")
def stop(cls): has_samba = cls.has_installed() if not has_samba: print("Samba has not been installed") return # shell.system("service samba stop") shell.system("service smbd stop") shell.system("service nmbd stop")
def status(cls, show_detail=False): has_samba = cls.has_installed() if not has_samba: if not show_detail: return "not installed" else: print("Samba has not been installed") return if show_detail: # shell.system("service samba status") shell.system("service smbd status") shell.system("service nmbd status") else: started = shell.check_command("service samba status") if not started: return "not started" return "running..."
def install(cls): has_samba = cls.has_installed() if has_samba: print("Smaba has already been installed") return shell.system("apt-get install -y samba")