gluon-core: add function to add users

This commit is contained in:
Matthias Schiffer 2014-01-14 18:19:51 +01:00
parent f99767fb9f
commit 3275c92f72

View File

@ -0,0 +1,12 @@
add_user() {
local username="$1"
local id="$2"
[ "$username" -a "$id" ] || return 1
sed -i "/^$username:/d" /etc/passwd
sed -i "/^$username:/d" /etc/shadow
echo "$username:*:$id:100:$username:/var:/bin/false" >> /etc/passwd
echo "$username:*:0:0:99999:7:::" >> /etc/shadow
}