diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-02 12:26:41 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-02 12:26:41 +0200 |
commit | 3ba8c84f2d541d819da1d7415fd3eeb853076bb0 (patch) | |
tree | ce0c0b93b3f8c65b60550cea550ecdc9d50f4eee /install/ishtar-delete-instance | |
parent | 0006cbb585410907719af13461ed9cd0d7aab0a0 (diff) | |
download | Ishtar-3ba8c84f2d541d819da1d7415fd3eeb853076bb0.tar.bz2 Ishtar-3ba8c84f2d541d819da1d7415fd3eeb853076bb0.zip |
Install script: putting color everywhere!
Diffstat (limited to 'install/ishtar-delete-instance')
-rwxr-xr-x | install/ishtar-delete-instance | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/install/ishtar-delete-instance b/install/ishtar-delete-instance index f67770d4d..de54154d2 100755 --- a/install/ishtar-delete-instance +++ b/install/ishtar-delete-instance @@ -2,6 +2,23 @@ set -e +cecho() { + local code="\033[" + case "$1" in + black | bk) color="${code}0;30m";; + red | r) color="${code}1;31m";; + green | g) color="${code}1;32m";; + yellow | y) color="${code}1;33m";; + blue | b) color="${code}1;34m";; + purple | p) color="${code}1;35m";; + cyan | c) color="${code}1;36m";; + gray | gr) color="${code}0;37m";; + *) local text="$1" + esac + [ -z "$text" ] && local text="$color$2${code}0m" + echo "$text" +} + do_delete_instance() { NGINX_AVAILABLE_PATH='/etc/nginx/sites-available' NGINX_ENABLE_PATH='/etc/nginx/sites-enabled' @@ -14,7 +31,7 @@ do_delete_instance() { if [ ! -f $CONFIG_PATH/config ]; then echo ""; - echo ""$CONFIG_PATH" is not a valid config file." + cecho r ""$CONFIG_PATH" is not a valid config file." echo "Have you properly install Ishtar sources?" echo "Run ishtar-install before this script."; echo ""; @@ -26,7 +43,7 @@ do_delete_instance() { INSTANCES_FILE=$CONFIG_PATH/instances if [ ! -f $INSTANCES_FILE ]; then echo ""; - echo "No instance installated. Exiting." + cecho r "No instance installed. Exiting." echo ""; exit 1; fi @@ -54,8 +71,8 @@ EOF fi done echo "" - echo "Are you really sure to delete configuration, database and media attached to the " - echo "instance "$to_delete"?" + cecho r "Are you really sure to delete configuration, database and media attached to the " + cecho r "instance "$to_delete"?" echo "" read -p "* Type DELETE if you are sure: " choice if [ "$choice" != "DELETE" ]; then |