Browse Source

Enhance-More Colours (#52)

enable colours in more scripts
change fail2ban.s to use arguments.sh to initialize it's variables
Mafoo 8 years ago
parent
commit
051a6b9711

+ 4 - 4
debian/resources/fail2ban.sh

@@ -1,13 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 
 
 #move to script directory so all relative paths work
 #move to script directory so all relative paths work
-#cd "$(dirname "$0")"
+cd "$(dirname "$0")"
 
 
-#initialize variable encase we are called directly
-[ -z $USE_FREESWITCH_SOURCE ] && USE_FREESWITCH_SOURCE=false
+. ./colors.sh
+. ./arguments.sh
 
 
 #send a message
 #send a message
-echo "Install Fail2ban"
+verbose "Installing Fail2ban"
 
 
 #add the dependencies
 #add the dependencies
 apt-get install -y --force-yes fail2ban
 apt-get install -y --force-yes fail2ban

+ 7 - 1
debian/resources/iptables.sh

@@ -1,7 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 
 
+#move to script directory so all relative paths work
+cd "$(dirname "$0")"
+
+. ./colors.sh
+. ./arguments.sh
+
 #send a message
 #send a message
-echo "Configure IPTables"
+verbose "Configuring IPTables"
 
 
 #run iptables commands
 #run iptables commands
 iptables -A INPUT -i lo -j ACCEPT
 iptables -A INPUT -i lo -j ACCEPT

+ 7 - 1
debian/resources/nginx.sh

@@ -1,7 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 
 
+#move to script directory so all relative paths work
+cd "$(dirname "$0")"
+
+. ./colors.sh
+. ./arguments.sh
+
 #send a message
 #send a message
-echo "Install the web server\n"
+verbose "Installing the web server"
 
 
 #install dependencies
 #install dependencies
 apt-get install -y --force-yes nginx php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt
 apt-get install -y --force-yes nginx php5 php5-cli php5-fpm php5-pgsql php5-sqlite php5-odbc php5-curl php5-imap php5-mcrypt

+ 7 - 1
debian/resources/php.sh

@@ -1,7 +1,13 @@
 #!/bin/sh
 #!/bin/sh
 
 
+#move to script directory so all relative paths work
+cd "$(dirname "$0")"
+
+. ./colors.sh
+. ./arguments.sh
+
 #send a message
 #send a message
-echo "Configure PHP"
+verbose "Configuring PHP"
 
 
 #update config if source is being used
 #update config if source is being used
 sed 's#post_max_size = .*#post_max_size = 80M#g' -i /etc/php5/fpm/php.ini
 sed 's#post_max_size = .*#post_max_size = 80M#g' -i /etc/php5/fpm/php.ini