add add-user() helper function

This commit is contained in:
parazyd 2017-02-23 15:06:28 +01:00
parent c9b130edb1
commit 9102ee317b
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
2 changed files with 18 additions and 1 deletions

View File

@ -89,6 +89,23 @@ getfield() {
print "$1" | grep "^$2=" | sed -e 's:.*=\(.*\)$:\1:g' | sed -e 's:^"\(.*\)"$:\1:g'
}
add-user() {
fn add-user $*
local user="$1"
local pass="$2"
req=(strapdir user pass)
ckreq || return 1
notice "adding user $user:$pass"
cat <<EOF | sudo tee ${strapdir}/adduser
#!/bin/sh
useradd -m ${user}
echo "${user}:${pass}" | chpasswd
EOF
chroot-script adduser || zerr
}
devprocsys() {
fn devprocsys "$@"
local watdo="$1"

View File

@ -72,7 +72,7 @@ menu title ${os} boot menu
timeout 300
label live-${arch}
menu label ^${os} Live (${arch})
menu label ^${os} live (${arch})
menu default
linux /live/vmlinuz
append initrd=/live/initrd boot=live