diff options
author | NeodarZ <neodarz@neodarz.net> | 2018-02-21 01:19:28 +0100 |
---|---|---|
committer | NeodarZ <neodarz@neodarz.net> | 2018-02-21 01:19:28 +0100 |
commit | 59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af (patch) | |
tree | 697031d7f0f1ecfe377fc100c4f85c12b4554780 /useradd.sh | |
download | archlinux_autoinstall-59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af.tar.xz archlinux_autoinstall-59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af.zip |
Initial commit
Diffstat (limited to '')
-rwxr-xr-x | useradd.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/useradd.sh b/useradd.sh new file mode 100755 index 0000000..252c092 --- /dev/null +++ b/useradd.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [[ $1 == "" || $2 == "" ]];then + read -p"username: " username + read -p"password: " password + read -p"retap password: " password2 + while [[ $password != $password2 || $password == "" ]] + do + echo "mismatch passord" + read -p"password: " password + read -p"retap password: " password2 + done +else + username=$1 + password=$2 +fi + +if [[ $username != "root" ]]; then + mkdir -p "build/airootfs/home/$username" +fi +echo $username":"$(mkpasswd -m sha-512 -S spaceunicorne -s <<< $password)":17076:0:99999:7:::" >> build/airootfs/etc/shadow |