summaryrefslogtreecommitdiff
path: root/install/ishtar-install
diff options
context:
space:
mode:
Diffstat (limited to 'install/ishtar-install')
-rwxr-xr-xinstall/ishtar-install71
1 files changed, 41 insertions, 30 deletions
diff --git a/install/ishtar-install b/install/ishtar-install
index c376e05f2..2b01c4e8e 100755
--- a/install/ishtar-install
+++ b/install/ishtar-install
@@ -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"
+}
+
command_exists() {
command -v "$@" > /dev/null 2>&1
}
@@ -55,10 +72,8 @@ EOF
elif command_exists su; then
sh_c='su -c'
else
- cat >&2 <<-'EOF'
- Error: this installer needs the ability to run commands as root.
- We are unable to find either "sudo" or "su" available to make this happen.
-EOF
+ cecho r " Error: this installer needs the ability to run commands as root."
+ cecho r " We are unable to find either "sudo" or "su" available to make this happen."
exit 1
fi
fi
@@ -153,12 +168,10 @@ EOF
ubuntu|debian)
;;
*)
- cat >&2 <<-'EOF'
-
- Sorry. Either your platform is not easily detectable or not supported by
- this installer.
-
-EOF
+ echo ""
+ cecho r " Sorry. Either your platform is not easily detectable or not supported by"
+ cecho r " this installer."
+ echo ""
exit 1
esac
@@ -224,8 +237,9 @@ EOF
etc_path="/etc/ishtar/"
if [ -d "$etc_path" ]; then
echo ""
- echo "ERROR: it seems that "$etc_path" already exists. If this is a remnant "
- echo "of an old installation please delete this path before installing."
+ cecho r "ERROR: it seems that "$etc_path" already exists. If this is a remnant "
+ cecho r "of an old installation please delete this path before installing."
+ echo ""
exit 1
fi
@@ -253,8 +267,9 @@ EOF
full_install_path=$install_path'/ishtar/'
if [ -d "$full_install_path" ]; then
echo ""
- echo "ERROR: it seems that "$full_install_path" already exists. If this is a "
- echo "remnant of an old installation please delete this directory before installing."
+ cecho r "ERROR: it seems that "$full_install_path" already exists. If this is a "
+ cecho r "remnant of an old installation please delete this directory before installing."
+ echo ""
exit 1
fi
@@ -266,11 +281,9 @@ EOF
case "$lsb_dist" in
ubuntu|debian)
if [ "$dist_version" != "jessie" ] && [ "$dist_version" != "wheezy" ]; then
- cat >&2 <<-'EOF'
-
- Sorry this script cannot manage your version of Debian/Ubuntu.
-
-EOF
+ echo ""
+ cecho r " Sorry this script cannot manage your version of Debian/Ubuntu."
+ echo ""
exit 1
fi
@@ -332,14 +345,12 @@ EOF
if [ "$dist_version" == "jessie" ]; then
if [ "$backports_activated" != 'true' ]; then
- cat >&2 <<-'EOF'
-
- In order to install Ishtar you have to activate Debian backports. To do that:
-
- echo "deb http://ftp.debian.org/debian jessie-backports main contrib non-free" >> "/etc/apt/sources.list"
-
- Run again Ishtar installation script after that.
-EOF
+ echo ""
+ cecho p " In order to install Ishtar you have to activate Debian backports. To do that:"
+ echo ""
+ echo " echo "deb http://ftp.debian.org/debian jessie-backports main contrib non-free" >> "/etc/apt/sources.list"
+ echo ""
+ cecho p " Run again Ishtar installation script after that."
exit 1
fi
@@ -386,10 +397,10 @@ EOF
echo ""
echo "*******************************************************************************";
echo "";
- echo "Installation done. Base configuration stored in "$etc_path"config file."
- echo "You can edit "$etc_path"extra_settings.py to add settings to all new instances."
+ cecho g "Installation done. Base configuration stored in "$etc_path"config file."
+ cecho g "You can edit "$etc_path"extra_settings.py to add settings to all new instances."
echo "";
- echo "Next you'll have to create an instance with ishtar-prepare-instance script."
+ cecho g "Next you'll have to create an instance with ishtar-prepare-instance script."
echo "";
}