user shell bash init
This commit is contained in:
parent
79a749dfb9
commit
758fab05df
1 changed files with 8 additions and 8 deletions
|
@ -29,19 +29,19 @@ case "$1" in
|
|||
SQL="${Q1}"
|
||||
;;
|
||||
|
||||
"add")
|
||||
"add")
|
||||
if [ $# -ne 4 ]
|
||||
then
|
||||
echo "Error: Invalid action."
|
||||
echo "$USAGE"
|
||||
exit $E_BADARGS
|
||||
echo "Error: Invalid action."
|
||||
echo "$USAGE"
|
||||
exit $E_BADARGS
|
||||
fi
|
||||
Q1="INSERT INTO usermgmt.users (username, name, description) VALUES ('$2', '$3', '$4');"
|
||||
Q1="INSERT INTO usermgmt.users (username, name, description) VALUES ('\$2', '\$3', '\$4');"
|
||||
SQL="${Q1}"
|
||||
PASSWORD=`openssl rand -base64 12`
|
||||
useradd -m -p "$PASSWORD" "$2"
|
||||
echo "$PASSWORD" > "/home/$2/password.txt"
|
||||
echo "This is your password. Please delete this file after saving the password." >> "/home/$2/password.txt"
|
||||
useradd -m -p "$PASSWORD" -s /bin/bash "\$2"
|
||||
echo "$PASSWORD" > "/home/\$2/password.txt"
|
||||
echo "This is your password. Please delete this file after saving the password." >> "/home/\$2/password.txt"
|
||||
;;
|
||||
|
||||
"delete")
|
||||
|
|
Reference in a new issue