This commit is contained in:
joglomedia
2019-08-15 22:08:49 +07:00
parent c938a9c90b
commit 87b17fa1cc
2 changed files with 14 additions and 3 deletions

View File

@@ -270,9 +270,9 @@ Now, you can reboot your server and enjoy it!"
run apt-get autoremove -y
status -e "\nLEMP stack has been removed completely."
warning -e "\nDid you know? that we're sad to see you leave :'(
If you are not satisfied with LEMPer stack or
have any reasons to uninstall it, please let us know ^^"
warning -e "\nDid you know? that e're sad to see you leave :'(
If you are not satisfied with LEMPer stack or have
any other reasons to uninstall it, please let us know ^^"
;;
--help)
echo "Please read the README file for more information!"

View File

@@ -464,6 +464,17 @@ function create_account() {
run chown -hR "${USERNAME}:${USERNAME}" "/home/${USERNAME}/webapps"
fi
# Add account credentials to /srv/.htpasswd
if [[ -n $(command -v mkpasswd) ]]; then
local PASSHASH=$(mkpasswd --method=sha-256 "${PASSWORD}")
run bash -c 'echo "${USERNAME}:${PASSHASH}" > /srv/.htpasswd'
elif [[ -n $(command -v htpasswd) ]]; then
run htpasswd -b /srv/.htpasswd "${USERNAME}" "${PASSWORD}"
else
local PASSHASH=$(openssl passwd -1 "${PASSWORD}")
run bash -c 'echo "${USERNAME}:${PASSWORD}" > /srv/.htpasswd'
fi
# Save data to log file.
echo "
Your default system account information: