Add function to create a user with default password if it does not exist
This commit is contained in:
parent
00f52c7336
commit
b848aa5799
@ -1,3 +1,7 @@
|
||||
kickstart.user.create() {
|
||||
kickstart.mute "id $1" || ( useradd -m -s /bin/bash -U -p `openssl passwd -1 $2` $1 )
|
||||
}
|
||||
|
||||
kickstart.user.add_group() {
|
||||
kickstart.info "Adding $2 group to $1"
|
||||
grep -q $2 <(groups $1) || usermod -a -G $2 $1
|
||||
|
Loading…
Reference in New Issue
Block a user