Exemple #1
0
 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")
Exemple #2
0
 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")
Exemple #3
0
 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..."
Exemple #4
0
 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")