makeppt

#!/usr/bin/env python
 
import os, sys
 
try:
sys.argv[1]
except:
print("Usage: makeppt CTID")
sys.exit(0)
 
try:
os.system("cp -rp /home/ppt-core /home/{0}".format(sys.argv[1]))
os.system("adduser {0}".format(sys.argv[1]))
os.system("echo {0}:.1ringfree2. | chpasswd".format(sys.argv[1])) 
os.system("chown -R {0}:{0} {0}".format(sys.argv[1])) 
os.system("cp -rf /var/www/html/ppt/ppt-core /var/www/html/ppt/{0}".format(sys.argv[1])) 
os.system("sed -i -e 's/19000/{0}/g' /var/www/html/ppt/{0}/config.php".format(sys.argv[1])) 
print("Success!")
except:
print("There was an error.")
sys.exit(1)