Add -r to read

I'm less certain about the necessity of this, but if it doesnt cause
problems, I dont see why not.
https://github.com/koalaman/shellcheck/wiki/SC2162
modified:   scripts/web-add.sh
This commit is contained in:
Patrick Marchand 2018-10-16 14:49:43 -04:00
parent 05c9525d7e
commit 97bad77040

View file

@ -574,7 +574,7 @@ op_del() {
fi fi
echo "Deleting account $login. Continue ?" echo "Deleting account $login. Continue ?"
read read -r
set -x set -x
userdel "$login" userdel "$login"
@ -631,7 +631,7 @@ op_del() {
if [ -n "$dbname" ]; then if [ -n "$dbname" ]; then
echo "Deleting mysql DATABASE $dbname and mysql user $login. Continue ?" echo "Deleting mysql DATABASE $dbname and mysql user $login. Continue ?"
read read -r
set -x set -x
echo "DROP DATABASE $dbname; delete from mysql.user where user='$login' ; FLUSH PRIVILEGES;" | mysql $MYSQL_OPTS echo "DROP DATABASE $dbname; delete from mysql.user where user='$login' ; FLUSH PRIVILEGES;" | mysql $MYSQL_OPTS
@ -787,7 +787,7 @@ op_add() {
until [ "$in_login" ]; do until [ "$in_login" ]; do
echo -n "Entrez le login du nouveau compte : " echo -n "Entrez le login du nouveau compte : "
read tmp read -r tmp
if validate_login "$tmp"; then if validate_login "$tmp"; then
in_login="$tmp" in_login="$tmp"
fi fi
@ -795,7 +795,7 @@ op_add() {
until [ "$in_passwd" ]; do until [ "$in_passwd" ]; do
echo -n "Entrez le mot de passe FTP/SFTP/SSH (ou vide pour aleatoire) : " echo -n "Entrez le mot de passe FTP/SFTP/SSH (ou vide pour aleatoire) : "
read -s tmp read -rs tmp
echo echo
if [ -z "$tmp" ]; then if [ -z "$tmp" ]; then
@ -808,12 +808,12 @@ op_add() {
done done
echo -n "Voulez-vous aussi un compte/base MySQL ? [Y|n] " echo -n "Voulez-vous aussi un compte/base MySQL ? [Y|n] "
read confirm read -r confirm
if [ "$confirm" != "n" ] && [ "$confirm" != "N" ]; then if [ "$confirm" != "n" ] && [ "$confirm" != "N" ]; then
until [ "$in_dbname" ]; do until [ "$in_dbname" ]; do
echo -n "Entrez le nom de la base de donnees ($in_login par defaut) : " echo -n "Entrez le nom de la base de donnees ($in_login par defaut) : "
read tmp read -r tmp
if [ -z "$tmp" ]; then if [ -z "$tmp" ]; then
tmp=$in_login tmp=$in_login
@ -826,7 +826,7 @@ op_add() {
until [ "$in_dbpasswd" ]; do until [ "$in_dbpasswd" ]; do
echo -n "Entrez le mot de passe MySQL (ou vide pour aleatoire) : " echo -n "Entrez le mot de passe MySQL (ou vide pour aleatoire) : "
read -s tmp read -rs tmp
echo echo
if [ -z "$tmp" ]; then if [ -z "$tmp" ]; then
@ -841,7 +841,7 @@ op_add() {
until [ "$in_wwwdomain" ]; do until [ "$in_wwwdomain" ]; do
echo -n "Entrez le nom de domaine web (ex: foo.example.com) : " echo -n "Entrez le nom de domaine web (ex: foo.example.com) : "
read tmp read -r tmp
if validate_wwwdomain "$tmp"; then if validate_wwwdomain "$tmp"; then
in_wwwdomain="$tmp" in_wwwdomain="$tmp"
fi fi
@ -849,8 +849,8 @@ op_add() {
if [ ${#PHP_VERSIONS[@]} -gt 0 ]; then if [ ${#PHP_VERSIONS[@]} -gt 0 ]; then
until [ "$in_phpversion" ]; do until [ "$in_phpversion" ]; do
echo -n "Entrez la version de PHP désirée parmis ${PHP_VERSIONS[@]} : " echo -n "Entrez la version de PHP désirée parmis ${PHP_VERSIONS[*]} : "
read tmp read -r tmp
if validate_phpversion "$tmp"; then if validate_phpversion "$tmp"; then
in_phpversion="$tmp" in_phpversion="$tmp"
fi fi
@ -859,7 +859,7 @@ op_add() {
until [ "$in_mail" ]; do until [ "$in_mail" ]; do
echo -n "Entrez votre adresse mail pour recevoir le mail de creation ($CONTACT_MAIL par défaut) : " echo -n "Entrez votre adresse mail pour recevoir le mail de creation ($CONTACT_MAIL par défaut) : "
read tmp read -r tmp
if [ -z "$tmp" ]; then if [ -z "$tmp" ]; then
tmp="$CONTACT_MAIL" tmp="$CONTACT_MAIL"
fi fi
@ -958,7 +958,7 @@ op_add() {
if [ -z "$force_confirm" ]; then if [ -z "$force_confirm" ]; then
echo -n "Confirmer la création ? [y/N] : " echo -n "Confirmer la création ? [y/N] : "
read tmp read -r tmp
echo echo
if [ "$tmp" != "y" ] && [ "$tmp" != "Y" ]; then if [ "$tmp" != "y" ] && [ "$tmp" != "Y" ]; then
echo "Annulation..." echo "Annulation..."