aboutsummaryrefslogtreecommitdiff
path: root/useradd.sh
diff options
context:
space:
mode:
authorNeodarZ <neodarz@neodarz.net>2018-02-21 01:19:28 +0100
committerNeodarZ <neodarz@neodarz.net>2018-02-21 01:19:28 +0100
commit59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af (patch)
tree697031d7f0f1ecfe377fc100c4f85c12b4554780 /useradd.sh
downloadarchlinux_autoinstall-59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af.tar.xz
archlinux_autoinstall-59e2ac74bd0c28d3c96f7f53ce09fc2c37b6e8af.zip
Initial commit
Diffstat (limited to 'useradd.sh')
-rwxr-xr-xuseradd.sh21
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