summaryrefslogtreecommitdiff
path: root/install/ishtar-delete-instance
diff options
context:
space:
mode:
Diffstat (limited to 'install/ishtar-delete-instance')
-rwxr-xr-xinstall/ishtar-delete-instance25
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