CC-2602 : Live show record silence

adding pypo to groups pulse and pulse-access
This commit is contained in:
Naomi Aro 2011-07-27 13:00:07 +02:00
parent 8b9cfd7cfa
commit 1ef785a0fd
1 changed files with 8 additions and 4 deletions

View File

@ -4,15 +4,15 @@ from subprocess import Popen, PIPE, STDOUT
def create_user(username): def create_user(username):
print "Checking for user "+username print "Checking for user "+username
p = Popen('id '+username, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) p = Popen('id '+username, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read() output = p.stdout.read()
if (output[0:3] != "uid"): if (output[0:3] != "uid"):
# Make the pypo user # Make the pypo user
print "Creating user "+username print "Creating user "+username
os.system("adduser --system --quiet --group --shell /bin/bash "+username) os.system("adduser --system --quiet --group --shell /bin/bash "+username)
#set pypo password #set pypo password
p = os.popen('/usr/bin/passwd pypo 1>/dev/null 2>&1', 'w') p = os.popen('/usr/bin/passwd pypo 1>/dev/null 2>&1', 'w')
p.write('pypo\n') p.write('pypo\n')
@ -24,11 +24,15 @@ def create_user(username):
os.system("adduser " + username + " audio 1>/dev/null 2>&1") os.system("adduser " + username + " audio 1>/dev/null 2>&1")
#add pypo to www-data group #add pypo to www-data group
os.system("adduser " + username + " www-data 1>/dev/null 2>&1") os.system("adduser " + username + " www-data 1>/dev/null 2>&1")
#add pypo to pulse group
os.system("adduser " + username + " pulse 1>/dev/null 2>&1")
#add pypo to pulse-access group
os.system("adduser " + username + " pulse-access 1>/dev/null 2>&1")
if __name__ == "__main__": if __name__ == "__main__":
if os.geteuid() != 0: if os.geteuid() != 0:
print "Please run this as root." print "Please run this as root."
sys.exit(1) sys.exit(1)
create_user("pypo") create_user("pypo")