replace yes/no by emoji

This commit is contained in:
Simon Vieille 2019-07-31 13:34:06 +02:00
parent 153ec73aa3
commit e38781f509
Signed by: deblan
GPG Key ID: 03383D15A1D31745
2 changed files with 9 additions and 7 deletions

View File

@ -39,6 +39,8 @@ WEB_HTTPS="$(form_yes_no -t "$TITLE" -l "Support of HTTPS (recommanded)")"
if [ "$WEB_HTTP" = "yes" ] && [ "$WEB_HTTPS" = "yes" ]; then if [ "$WEB_HTTP" = "yes" ] && [ "$WEB_HTTPS" = "yes" ]; then
WEB_HTTPS_FORCE="$(form_yes_no -t "$TITLE" -l "Redirect HTTP to HTTPS (recommanded)")" WEB_HTTPS_FORCE="$(form_yes_no -t "$TITLE" -l "Redirect HTTP to HTTPS (recommanded)")"
else
WEB_HTTPS_FORCE="no"
fi fi
#if [ "$WEB_HTTPS" = "yes" ]; then #if [ "$WEB_HTTPS" = "yes" ]; then
@ -61,7 +63,7 @@ if [ "$PHP_ENABLED" = "yes" ]; then
exit_if_empty "$PHP_VERSION" "Aborded! (PHP_VERSION_EMPTY)" exit_if_empty "$PHP_VERSION" "Aborded! (PHP_VERSION_EMPTY)"
fi fi
USER_PASSWORD="$(tr -dc "12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)" USER_PASSWORD="$(tr -dc "0123456789!@#$%()[]*@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" < /dev/urandom | head -c 20)"
SYSTEM_USER_USERNAME="$(form_input -t "$TITLE" -l "System username" -d "web" -r)" SYSTEM_USER_USERNAME="$(form_input -t "$TITLE" -l "System username" -d "web" -r)"
SYSTEM_USER_GROUP="webgroup" SYSTEM_USER_GROUP="webgroup"
@ -94,7 +96,7 @@ export WEB_HTTPS_FORCE
TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)" TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)"
template summary > "$TMP_FILE" template summary > "$TMP_FILE"
chmod 600 "$TMP_FILE" chmod 600 "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 20 80 whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE" rm "$TMP_FILE"
CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?")" CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?")"
@ -159,7 +161,7 @@ done
export USER_PASSWORD export USER_PASSWORD
TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)" TMP_FILE="/tmp/vhost-add-$(tr -dc "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" < /dev/urandom | head -c 16)"
template result > "$TMP_FILE" template result > "$TMP_FILE"
chmod 600 "$TMP_FILE" chmod 600 "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 25 80 whiptail --textbox "$TMP_FILE" 25 80

View File

@ -9,11 +9,11 @@
│ GROUP │ {{ '%- 25s'|format(SYSTEM_USER_GROUP) }} │ GROUP │ {{ '%- 25s'|format(SYSTEM_USER_GROUP) }}
└──────────┴───────────────────────────┘ └──────────┴───────────────────────────┘
┌──────────────┬─────┐ ┌──────────────┬─────┐
│ HTTP │ {{ '%- 3s'|format(WEB_HTTP) }} │ HTTP │ {{ '%- 3s'|format(WEB_HTTP|replace({'yes': ' ✔ ', 'no': ' ✖ '})) }}
│ HTTPS │ {{ '%- 3s'|format(WEB_HTTPS) }} │ HTTPS │ {{ '%- 3s'|format(WEB_HTTPS|replace({'yes': ' ✔ ', 'no': ' ✖ '})) }}
│ HTTP → HTTPS │ {{ '%- 3s'|format(WEB_HTTPS_FORCE) }} │ HTTP → HTTPS │ {{ '%- 3s'|format(WEB_HTTPS_FORCE|replace({'yes': ' ✔ ', 'no': ' ✖ '})) }}
└──────────────┴─────┘ └──────────────┴─────┘
┌─────────────┬─────┐ ┌─────────────┬─────┐
│ PHP ENABLED │ {{ '%- 3s'|format(PHP_ENABLED) }} │ PHP ENABLED │ {{ '%- 3s'|format(PHP_ENABLED|replace({'yes': ' ✔ ', 'no': ' ✖ '})) }}
│ PHP VERSION │ {{ '%- 3s'|format(PHP_VERSION) }} │ PHP VERSION │ {{ '%- 3s'|format(PHP_VERSION) }}
└─────────────┴─────┘ └─────────────┴─────┘