Update adduser.sh
This commit is contained in:
parent
b2146f5646
commit
e7d7950a35
1 changed files with 5 additions and 5 deletions
10
adduser.sh
10
adduser.sh
|
@ -1,17 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Enter username"
|
||||
read username
|
||||
if grep "^"$username":" /etc/ipsec.d/passwd
|
||||
read -r username
|
||||
if grep "^$username:" /etc/ipsec.d/passwd
|
||||
then
|
||||
echo "username exist"
|
||||
echo "Username already exist"
|
||||
exit 1
|
||||
fi
|
||||
echo "Enter password"
|
||||
read password
|
||||
read -r password
|
||||
password=$(openssl passwd -1 "$password")
|
||||
echo $username":"$password":xauth-psk" >> /etc/ipsec.d/passwd
|
||||
if grep "^"$username":" /etc/ipsec.d/passwd
|
||||
if grep "^$username:" /etc/ipsec.d/passwd
|
||||
then
|
||||
echo "Success to add"
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue