From e1b3bc814ce0c90a7b60849987f5112ace4aba31 Mon Sep 17 00:00:00 2001 From: quackerd Date: Fri, 19 Feb 2021 18:43:08 -0500 Subject: [PATCH] change example --- add-user-group.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add-user-group.py b/add-user-group.py index 4d98da4..87d9b60 100644 --- a/add-user-group.py +++ b/add-user-group.py @@ -34,14 +34,14 @@ def main(): uname = elements[0] uid = elements[1] passwd = elements[2] - subprocess.check_call("adduser -D -H -u ", shlex.quote(uid), shlex.quote(uname), shell=True) + subprocess.check_call("adduser -D -H -u " + shlex.quote(uid) + " " + shlex.quote(uname), shell=True) print("Added user " + uname + " with uid " + uid) if (len(elements) == 4): gname = elements[3] subprocess.check_call("addgroup " + shlex.quote(uname) + " " + shlex.quote(gname), shell=True) print("Added user " + uname + " to group " + gname) # set passwd - subprocess.check_call("echo -ne " + shlex.quote("\n" + passwd + "\n" + passwd + "\n") + " | smbpasswd -a -U " + shlex.quote(uname), shell=True) + subprocess.check_call("echo -ne " + shlex.quote(passwd + "\n" + passwd + "\n") + " | smbpasswd -a -U " + shlex.quote(uname), shell=True) print("Set user " + uname + " password to " + passwd) main() \ No newline at end of file