sintonia/python_apps/remove-pypo-user.py
martin 4c9c86bf4f cc-2055: switch to init.d
-remove update-rc.d on uninstall
-remove unecessary imports in install/uninstall scripts
-all daemons now wait until apache2 is available before starting (LSB Init Script)
2011-06-02 18:07:48 -04:00

18 lines
484 B
Python

import os
import time
def remove_user(username):
os.system("killall -u %s 1>/dev/null 2>&1" % username)
#allow all process to be completely closed before we attempt to delete user
print "Waiting for processes to close..."
time.sleep(3)
os.system("deluser --remove-home " + username + " 1>/dev/null 2>&1")
if __name__ == "__main__":
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
remove_user("pypo")