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)
This commit is contained in:
parent
6ab5ac4582
commit
4c9c86bf4f
12 changed files with 42 additions and 20 deletions
|
@ -1,29 +0,0 @@
|
|||
import os
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
def create_user(username):
|
||||
print "Checking for user "+username
|
||||
|
||||
p = Popen('id '+username, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
output = p.stdout.read()
|
||||
|
||||
if (output[0:3] != "uid"):
|
||||
# Make the pypo user
|
||||
print "Creating user "+username
|
||||
os.system("adduser --system --quiet --group --shell /bin/bash "+username)
|
||||
|
||||
#set pypo password
|
||||
p = os.popen('/usr/bin/passwd pypo 1>/dev/null 2>&1', 'w')
|
||||
p.write('pypo\n')
|
||||
p.write('pypo\n')
|
||||
p.close()
|
||||
else:
|
||||
print "User already exists."
|
||||
#add pypo to audio group
|
||||
os.system("adduser " + username + " audio 1>/dev/null 2>&1")
|
||||
#add pypo to www-data group
|
||||
os.system("adduser " + username + " www-data 1>/dev/null 2>&1")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
create_user("pypo")
|
Loading…
Add table
Add a link
Reference in a new issue