diff --git a/adduser.sh b/adduser.sh new file mode 100644 index 0000000..5a71cfe --- /dev/null +++ b/adduser.sh @@ -0,0 +1,11 @@ +echo "Enter username" +read username +if grep "^"$username":" /etc/ipsec.d/passwd +then + echo "username exist" + exit 1 +fi +echo "Enter password" +read password +password=$(openssl passwd -1 "$password") +echo $username":"$password":xauth-psk" >> /etc/ipsec.d/passwd