libretime/python_apps/remove_pypo_user.py
martin 6ab5ac4582 cc-2055: switch to init.d
-allow install script to be created from any location (no hardcoded paths)
-make python install scripts return 1 on error
-daemon now started automatically on boot using rc.local autostart
-change all prints to logs instead
-create airtime-uninstall shell script (and remove pypo user in here)
-create pypo user in shell script
2011-06-02 18:07:48 -04:00

15 lines
388 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__":
remove_user("pypo")