Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SRMP(Send/Receive Mail Protocol) è un protocollo creato da me(MRtecno98) per lo scambio
- #di messaggi via internet, questo programma imposta un server basato su questo
- #protocollo appunto.
- #Istruzioni in GUI, ricordatevi però dei dati forniti con il comando "show"
- #la password dell'utente root è sempre "admin"
- import os , json
- dirname = "SRMP"
- nameroot = "root"
- rootaccount = {"name" : "root" , "password" : "admin"}
- print("SRMP Server Setup".center(40 , "="))
- print("start: Start the setup of the server")
- print("select: select options of the setup")
- print("show: show options of setup")
- print("="*40)
- while True :
- opp = input("setup> ")
- if opp == "start" :
- os.mkdir(os.path.join(".",dirname))
- accounts = {rootaccount["name"] : rootaccount["password"]}
- jsonAccounts = json.dumps(accounts)
- file = open(os.path.join("." , dirname , "accounts.json") , "w")
- file.write(jsonAccounts)
- file.close()
- os.mkdir(os.path.join(".",dirname,rootaccount["name"]))
- print("Setup Finish!")
- elif opp == "select" :
- print("Insert Settings of the Setup, press enter for default")
- rootname = input("Insert name of root account(Default: 'root'): ")
- namedir = input("Insert name of directory contains server files(Default 'SRMP'): ")
- if rootname == "" :
- rootname = "root"
- if namedir == "" :
- namedir = "SRMP"
- nameroot = rootname
- dirname = namedir
- elif opp == "show" :
- print("Name of directory of SRMP: " + dirname)
- print("Name of root account of SRMP: " + nameroot)
- elif opp.replace(" " , "").replace("\n") == "" :
- continue
- else :
- print("Errated Command")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement