2017-09-16 20:37:13 +00:00
#!/bin/bash
# Server Stack Manager
# Syntax: stack <option> <arguments>
2018-06-22 22:15:03 +00:00
# Options: -html, -nginx, -php, -lemp, -mysql, -pma, -info, -purge-server-all, -php-ver
2017-09-16 20:37:13 +00:00
# Arguments: -purge, -notools, -noptim
source /opt/webinoly/lib/install
2018-03-19 21:11:09 +00:00
source /opt/webinoly/lib/webin
2017-09-16 20:37:13 +00:00
opt="$1"
arg="$2"
2018-02-18 04:08:16 +00:00
2017-09-16 20:37:13 +00:00
# Check if user entered arg before option and correct it.
2018-04-03 19:27:58 +00:00
if [[ $opt == "-purge" || $opt == "-notools" || $opt == "-noptim" ]]; then
2017-09-16 20:37:13 +00:00
opt="$2"
arg="$1"
fi
2018-02-18 04:08:16 +00:00
# FORCE - Unattended Purge
clear_force_flag() {
2018-02-26 01:13:30 +00:00
[[ $(conf_read force-flag) == "true" ]] && conf_delete force-flag
2018-02-18 04:08:16 +00:00
}
2018-02-26 00:49:57 +00:00
if [[ $arg == "-purge=force" || $opt == "-purge-server-all=force" || $opt == "-php=force" ]]; then
2018-02-26 01:13:30 +00:00
conf_write force-flag true
2018-02-18 04:08:16 +00:00
[[ $arg == "-purge=force" ]] && arg="-purge"
[[ $opt == "-purge-server-all=force" ]] && opt="-purge-server-all"
2018-02-26 00:49:57 +00:00
[[ $opt == "-php=force" ]] && opt="-php"
2018-02-18 04:08:16 +00:00
force="1"
fi
2018-04-03 19:27:58 +00:00
# Extract value if exist
2018-05-08 04:41:45 +00:00
if [[ $opt == "-nginx="* || $opt == "-html="* || $opt == "-lemp="* || $opt == "-php="* || $opt == "-php-ver="* ]]; then
2018-04-03 19:27:58 +00:00
value=$(echo "${opt}" | cut -d'=' -f 2 -s)
opt=$(echo "${opt}" | cut -d'=' -f 1 -s)
fi
2018-02-18 04:08:16 +00:00
2018-04-01 03:08:40 +00:00
# LEMP without Optimization for testing purpose (just packages)!
2017-09-16 20:37:13 +00:00
if [[ $arg == "-noptim" && $opt == "-lemp" ]]; then
if ! [[ $(conf_read nginx) == "true" || $(conf_read php) == "true" || $(conf_read mysql) == "true" ]]; then
nginx_install
php_install
mysql_install
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}LEMP without optimization has been installed!!! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
messagend_install dbpass
else
echo "${red}[ERROR] Some packages are already installed!${end}"
fi
2018-02-18 04:08:16 +00:00
2017-09-16 20:37:13 +00:00
# Delete some stack
elif [[ $arg == "-purge" && ( $opt == "-html" || $opt == "-nginx" ) ]]; then
2018-06-22 19:30:13 +00:00
api-events_update pn1
2017-09-16 20:37:13 +00:00
if [[ $(conf_read nginx) != "true" ]]; then
2018-04-01 03:08:40 +00:00
echo "${red}Nginx is not installed, hence can not be deleted! ${end}"
2018-02-18 04:08:16 +00:00
clear_force_flag
2018-04-27 00:20:30 +00:00
# Use "0" because any other number cause running commands twice when using "force" in -purge-server-all
exit 0
2017-09-16 20:37:13 +00:00
fi
echo ""
echo "${red} ¡ C A U T I O N ! You are about to remove NGINX from your server!"
echo ""
2018-04-01 03:08:40 +00:00
2018-02-26 01:13:30 +00:00
if [[ $(conf_read force-flag) != "true" ]]; then
2017-09-16 20:37:13 +00:00
echo " ${blu} Are you sure [y/N]? ${end}"
while read -r -n 1 -s answer; do
answer=${answer:-n}
2018-04-01 03:08:40 +00:00
[[ $answer = [YyNn] ]] && break
2017-09-16 20:37:13 +00:00
done
fi
2018-02-26 01:13:30 +00:00
if [[ $answer == [Yy] || $(conf_read force-flag) == "true" ]]; then
if [[ $(conf_read force-flag) == "true" && $force == 1 ]]; then
2018-02-18 04:08:16 +00:00
answer="Y"
else
echo ""
echo "${blu}Do you want to delete your sites data directory (/var/www) [Y/n]? ${end}"
while read -r -n 1 -s answer; do
answer=${answer:-y}
2018-04-01 03:08:40 +00:00
[[ $answer = [YyNn] ]] && break
2018-02-18 04:08:16 +00:00
done
fi
if [[ $answer == [Yy] ]]; then
2018-04-01 03:08:40 +00:00
[[ $(conf_read mysql-tool) == "true" ]] && stack -pma -purge
2018-06-22 19:30:13 +00:00
api-events_update pn2
2018-02-18 04:08:16 +00:00
site -delete-all
sudo rm -rf /var/www/$(conf_read tools-port)
sudo rm -rf /var/www/html
2018-06-22 19:30:13 +00:00
api-events_update pn3
2018-02-18 04:08:16 +00:00
fi
2017-09-16 20:37:13 +00:00
sudo service nginx stop
sudo apt-get -y purge nginx nginx-common
2018-04-03 19:27:58 +00:00
[[ $(conf_read nginx-ppa) == "mainline" ]] && echo | sudo add-apt-repository --remove 'ppa:nginx/development' || echo | sudo add-apt-repository --remove 'ppa:nginx/stable'
2018-06-22 19:30:13 +00:00
api-events_update pn4
api-events_update pn5
2018-05-03 02:10:01 +00:00
sudo apt-get -y purge letsencrypt python-boto duplicity duply
2017-09-16 20:37:13 +00:00
sudo apt-get -y autoremove
sudo rm $HOME/www
2018-05-03 02:10:01 +00:00
sudo rm $HOME/sites-available
2018-06-22 19:30:13 +00:00
api-events_update pn6
2017-09-16 20:37:13 +00:00
linux_purge
conf_write nginx purged
conf_write nginx-optim purged
conf_write nginx-tool purged
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}Nginx has been deleted successfully! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo ""
echo " ${gre} Action aborted!!! ${end}"
echo ""
fi
echo ""
elif [[ $arg == "-purge" && $opt == "-php" ]]; then
2018-06-22 19:30:13 +00:00
api-events_update pp1
2017-09-16 20:37:13 +00:00
if [[ $(conf_read php) != "true" ]]; then
2018-04-01 03:08:40 +00:00
echo "${red}PHP is not installed, hence can not be deleted! ${end}"
2018-02-18 04:08:16 +00:00
clear_force_flag
2018-04-27 00:20:30 +00:00
exit 0
2017-09-16 20:37:13 +00:00
fi
2018-05-08 04:41:45 +00:00
2017-09-16 20:37:13 +00:00
echo ""
echo "${red} ¡ C A U T I O N ! You are about to remove PHP from your server!"
echo " This action will also remove PhpMyAdmin if its installed because depends on PHP. ${end}"
echo ""
2018-05-08 04:41:45 +00:00
2018-02-26 01:13:30 +00:00
if [[ $(conf_read force-flag) != "true" ]]; then
2017-09-16 20:37:13 +00:00
echo " ${blu} Are you sure [y/N]? ${end}"
while read -r -n 1 -s answer; do
2018-05-08 04:41:45 +00:00
answer=${answer:-n}
[[ $answer = [YyNn] ]] && break
2017-09-16 20:37:13 +00:00
done
fi
2018-02-26 01:13:30 +00:00
if [[ $answer == [Yy] || $(conf_read force-flag) == "true" ]]; then
2018-04-01 03:08:40 +00:00
[[ $(conf_read mysql-tool) == "true" ]] && stack -pma -purge
2017-09-16 20:37:13 +00:00
sudo service php*-fpm stop
2017-11-30 04:33:55 +00:00
sudo apt-get -y purge php*-fpm php*-curl php*-gd php*-imap php*-mcrypt php*-readline php*-common php*-recode php*-mysql php*-cli php*-mbstring php*-bcmath php*-mysql php*-opcache php*-zip php*-xml php*-soap php-imagick graphviz php-pear php-xdebug php-msgpack
2017-11-29 00:18:18 +00:00
sudo apt-get -y purge php-memcached php-memcache memcached
2017-09-16 20:37:13 +00:00
sudo apt-get -y purge redis-server php-redis postfix
2017-11-29 00:18:18 +00:00
echo | sudo add-apt-repository --remove 'ppa:ondrej/php'
2017-12-05 01:30:55 +00:00
echo | sudo add-apt-repository --remove 'ppa:chris-lea/redis-server'
2017-09-16 20:37:13 +00:00
sudo apt-get -y autoremove
sudo rm -rf /etc/php
sudo rm /opt/webinoly/templates/source/*
2018-05-08 04:41:45 +00:00
2017-09-16 20:37:13 +00:00
conf_write php purged
conf_write php-optim purged
2018-05-08 04:41:45 +00:00
[[ $(conf_read php-v7.2) == "true" ]] && conf_write php-v7.2 purged
[[ $(conf_read php-v7.1) == "true" ]] && conf_write php-v7.1 purged
[[ $(conf_read php-v7.0) == "true" ]] && conf_write php-v7.0 purged
[[ $(conf_read php-v5.6) == "true" ]] && conf_write php-v5.6 purged
2017-09-16 20:37:13 +00:00
if [[ $(conf_read php-tool) == "true" ]]; then
rm -rf /var/www/$(conf_read tools-port)/htdocs/fpm
rm -rf /var/www/$(conf_read tools-port)/htdocs/php
conf_write php-tool purged
fi
2018-05-08 04:41:45 +00:00
2017-09-16 20:37:13 +00:00
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}PHP has been deleted successfully! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo ""
echo " ${gre} Action aborted!!! ${end}"
echo ""
fi
echo ""
2018-06-22 19:30:13 +00:00
api-events_update pp2
2018-05-08 04:48:54 +00:00
2017-09-16 20:37:13 +00:00
elif [[ $arg == "-purge" && $opt == "-mysql" ]]; then
2018-06-22 19:30:13 +00:00
api-events_update pm1
2017-09-16 20:37:13 +00:00
if [[ $(conf_read mysql) != "true" ]]; then
2018-04-01 03:08:40 +00:00
echo "${red}MySQL is not installed, hence can not be deleted! ${end}"
2018-02-18 04:08:16 +00:00
clear_force_flag
2018-04-27 00:20:30 +00:00
exit 0
2017-09-16 20:37:13 +00:00
fi
echo ""
echo "${red} ¡ C A U T I O N ! You are about to remove MySQL from your server! ${end}"
echo ""
2018-04-01 03:08:40 +00:00
2018-02-26 01:13:30 +00:00
if [[ $(conf_read force-flag) != "true" ]]; then
2017-09-16 20:37:13 +00:00
echo " ${blu} Are you sure [y/N]? ${end}"
while read -r -n 1 -s answer; do
answer=${answer:-n}
2018-04-01 03:08:40 +00:00
[[ $answer = [YyNn] ]] && break
2017-09-16 20:37:13 +00:00
done
fi
2018-02-26 01:13:30 +00:00
if [[ $answer == [Yy] || $(conf_read force-flag) == "true" ]]; then
2017-09-16 20:37:13 +00:00
if [[ $(conf_read mysql-tool) == "true" ]]; then
conf_write delautopma true
stack -pma -purge
conf_delete delautopma
fi
sudo service mysql stop
2018-05-18 22:55:57 +00:00
echo "mariadb-server-10.2 mariadb-server-10.2/postrm_remove_databases boolean true" | debconf-set-selections
sudo apt-get -y purge mariadb-server mariadb-common mysql-common
2017-09-16 20:37:13 +00:00
sudo apt-get -y purge mariadb-client
2018-05-18 22:55:57 +00:00
sudo apt-get -y purge debconf-utils
2017-09-16 20:37:13 +00:00
sudo apt-get -y autoremove
2017-12-05 01:30:55 +00:00
os_name=$(check_osname)
sudo add-apt-repository --remove "deb [arch=amd64,i386,ppc64el] http://mirrors.syringanetworks.net/mariadb/repo/10.2/ubuntu ${os_name} main"
# Cases with MariaDB v10.2 support
case "$os_name" in
"trusty")
sudo apt-key del 0xcbcb082a1bb943db
;;
2018-05-18 22:55:57 +00:00
"xenial"|"zesty"|"artful"|"bionic")
2017-12-05 01:30:55 +00:00
sudo apt-key del 0xF1656F24C74CD1D8
;;
esac
2017-09-16 20:37:13 +00:00
sudo rm -rf /etc/mysql
sudo rm -rf /var/lib/mysql
conf_delete mysql-root
conf_delete mysql-admin
conf_write mysql-client purged
conf_write mysql purged
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}MySQL has been deleted successfully! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo ""
echo " ${gre} Action aborted!!! ${end}"
echo ""
fi
echo ""
2018-06-22 19:30:13 +00:00
api-events_update pm4
2017-09-16 20:37:13 +00:00
elif [[ $arg == "-purge" && $opt == "-pma" ]]; then
2018-06-22 19:30:13 +00:00
api-events_update pm2
2017-09-16 20:37:13 +00:00
if [[ $(conf_read mysql-tool) != "true" ]]; then
echo "${red} PhpMyAdmin is not installed, hence can not be deleted! ${end}"
2018-02-18 04:08:16 +00:00
clear_force_flag
2018-04-27 00:20:30 +00:00
exit 0
2017-09-16 20:37:13 +00:00
fi
echo ""
echo "${red} ¡ C A U T I O N ! You are about to remove PhpMyAdmin from your server! ${end}"
echo ""
2018-04-01 03:08:40 +00:00
2018-02-26 01:13:30 +00:00
if [[ $(conf_read force-flag) != "true" && $(conf_read delautopma) != "true" ]]; then
2017-09-16 20:37:13 +00:00
echo " ${blu} Are you sure [y/N]? ${end} "
while read -r -n 1 -s answer; do
answer=${answer:-n}
if [[ $answer = [YyNn] ]]; then
break
fi
done
fi
2018-02-26 01:13:30 +00:00
if [[ $answer == [Yy] || $(conf_read force-flag) == "true" || $(conf_read delautopma) == "true" ]]; then
2017-09-16 20:37:13 +00:00
echo "phpmyadmin phpmyadmin/dbconfig-remove boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/purge boolean true" | debconf-set-selections
sudo apt-get -y purge phpmyadmin
sudo apt-get -y autoremove
sudo rm -rf /var/www/$(conf_read tools-port)/htdocs/pma
conf_write mysql-tool purged
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}PhpMyAdmin has been deleted successfully! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo ""
echo " ${gre} Action aborted!!! ${end}"
echo ""
fi
echo ""
2018-06-22 19:30:13 +00:00
api-events_update pm3
2018-06-22 22:15:03 +00:00
2017-09-16 20:37:13 +00:00
elif [[ $arg == "-purge" && $opt == "-lemp" ]]; then
echo ""
echo "${red}If you want to remove Webinoly Stack completely from your server use the '-purge-server-all' option or remove each package individually. ${end}"
echo ""
elif [[ $arg != "-purge" && $arg != "-notools" && -n "$arg" ]]; then
echo ""
echo "${red} $arg is not a valid argument! ${end}"
echo ""
# Install some stack
elif [[ $opt == "-html" || $opt == "-nginx" ]]; then
if [[ $(conf_read nginx) != "true" ]]; then
nginx_install
nginx_optim
2018-04-01 03:08:40 +00:00
[[ $arg != "-notools" ]] && nginx_tool
2017-09-16 20:37:13 +00:00
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}Nginx has been successfully Optimized by Webinoly! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo "${red}Nginx is already installed!${end}"
if [[ $(conf_read nginx-optim) != "true" ]]; then
nginx_optim
echo "${gre}"
2018-04-01 03:08:40 +00:00
echo "NGINX has been successfully Optimized by Webinoly!"
2017-09-16 20:37:13 +00:00
echo "${end}"
fi
if [[ $(conf_read nginx-tool) != "true" && $arg != "-notools" ]]; then
nginx_tool
echo "${gre}"
echo "NGINX Tools has been re-installed!"
echo "${end}"
fi
fi
elif [[ $opt == "-php" ]]; then
2018-05-08 04:41:45 +00:00
if [[ $(conf_read php) != "true" || ( -n $value && $(conf_read php-v${value}) != "true" ) ]]; then
2018-02-26 01:13:30 +00:00
if [[ $(conf_read nginx) != "true" && $(conf_read force-flag) != "true" ]]; then
2017-09-16 20:37:13 +00:00
echo ""
echo "${blu}Nginx is not installed, do you want to install it too [Y/n]?${end} "
while read -r -n 1 -s answer; do
answer=${answer:-y}
2018-04-01 03:08:40 +00:00
[[ $answer = [YyNn] ]] && break
2017-09-16 20:37:13 +00:00
done
2018-04-01 03:08:40 +00:00
[[ $answer != [Nn] ]] && stack -nginx $arg
2017-09-16 20:37:13 +00:00
fi
2018-05-08 04:41:45 +00:00
[[ -n $value ]] && php_install $value || php_install
[[ -n $value && $(conf_read php-v${value}) == "true" ]] && php_optim $value
[[ -z $value ]] && php_optim
def=$(conf_read php-ver)
[[ $arg != "-notools" && $(conf_read php-tool) != "true" ]] && php_tool
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}PHP has been successfully Optimized by Webinoly! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
else
echo "${red}PHP is already installed!${end}"
if [[ $(conf_read php-optim) != "true" ]]; then
php_optim
echo "${gre}"
2018-04-01 03:08:40 +00:00
echo "PHP has been successfully Optimized by Webinoly!"
2017-09-16 20:37:13 +00:00
echo "${end}"
fi
if [[ $(conf_read php-tool) != "true" && $arg != "-notools" ]]; then
php_tool
echo "${gre}"
echo "PHP Tools has been re-installed!"
echo "${end}"
fi
fi
elif [[ $opt == "-mysql" ]]; then
if [[ $(conf_read mysql) != "true" ]]; then
mysql_install
2018-04-01 03:08:40 +00:00
[[ $arg != "-notools" ]] && stack -pma
2017-09-16 20:37:13 +00:00
messagend_install dbpass
else
echo "${red}MySQL is already installed!${end}"
if [[ $(conf_read mysql-tool) != "true" && $arg != "-notools" ]]; then
stack -pma
echo "${gre}"
echo "MySQL Tools has been re-installed!"
echo "${end}"
fi
fi
elif [[ $opt == "-pma" ]]; then
if [[ $(conf_read mysql) != "true" || $(conf_read php) != "true" || $(conf_read nginx) != "true" || $(conf_read nginx-tool) != "true" ]]; then
echo "${red} You need to have MySQL, PHP and NGINX installed before you can install PhpMyAdmin! ${end}"
2018-02-18 04:08:16 +00:00
clear_force_flag
2018-04-27 00:20:30 +00:00
exit 0
2017-09-16 20:37:13 +00:00
fi
2018-04-01 03:08:40 +00:00
[[ $(conf_read mysql-tool) != "true" ]] && mysql_tool || echo "${red}PhpMyAdmin is already installed!${end}"
2017-09-16 20:37:13 +00:00
elif [[ $opt == "-lemp" ]]; then
2018-04-05 17:37:20 +00:00
[[ $value =~ ^(stable|mainline)$ ]] && stack -nginx=$value $arg || stack -nginx $arg
2017-09-16 20:37:13 +00:00
stack -php $arg
stack -mysql $arg
echo ""
2018-04-01 03:08:40 +00:00
echo "${gre}Nginx, PHP, MySQL (MariaDB) and some other useful tools have been installed successfully! ${end}"
2017-09-16 20:37:13 +00:00
echo ""
2018-05-08 04:41:45 +00:00
elif [[ $opt == "-php-ver" ]]; then
if [[ $(conf_read multi-php) == "true" ]]; then
echo "${red}This command is disabled because Multi-PHP is enabled!${end}"
exit 0
fi
if [[ -n $value && ($value == "7.2" || $value == "7.1" || $value == "7.0" || $value == "5.6") ]]; then
echo "${blu}New PHP version: '$value' ${end}"
if [[ $(conf_read php) == "true" && $(conf_read php-ver) == $value ]]; then
echo "${red}PHP $value is currently installed!${end}"
2018-02-25 23:51:57 +00:00
elif [[ $(conf_read php) == "true" && $(conf_read mysql-tool) == "true" ]]; then
2018-02-18 04:08:16 +00:00
sudo stack -php -purge=force
2018-05-08 04:41:45 +00:00
conf_write php-ver $value
2018-02-26 00:37:26 +00:00
# force flag prevent to be questioned (Unattended) when nginx is not installed.
2018-02-26 01:13:30 +00:00
conf_write force-flag true
2017-12-21 03:43:34 +00:00
sudo stack -php
sudo stack -pma
elif [[ $(conf_read php) == "true" && $(conf_read mysql-tool) != "true" ]]; then
2018-02-18 04:08:16 +00:00
sudo stack -php -purge=force
2018-05-08 04:41:45 +00:00
conf_write php-ver $value
2018-02-26 01:13:30 +00:00
conf_write force-flag true
2017-12-21 03:43:34 +00:00
sudo stack -php
elif [[ $(conf_read php) != "true" && $(conf_read mysql-tool) != "true" ]]; then
2018-05-08 04:41:45 +00:00
conf_write php-ver $value
echo "${gre}PHP is not already installed but new version will be installed next time! ${end}"
2017-12-21 03:43:34 +00:00
fi
2018-02-26 00:37:26 +00:00
clear_force_flag
2017-12-21 03:43:34 +00:00
else
2018-05-08 04:41:45 +00:00
echo "${red}Please, enter a valid PHP version!${end}"
2017-12-21 03:43:34 +00:00
fi
2018-04-01 03:08:40 +00:00
2017-09-16 20:37:13 +00:00
# Info & Purge-Server-All
elif [[ $opt == "-info" ]]; then
system_info
elif [[ $opt == "-purge-server-all" ]]; then
echo ""
echo "${red} ¡ C A U T I O N ! You are about to remove Webinoly Stack completely from your server!"
echo " This action will remove Nginx, PHP, MySQL and all the other tools, all your sites will remain in the server but will be publicly unavailable after this action."
echo ""
echo " If you want to remove your sites data use the webinoly command: 'sudo webinoly -delete-all'"
echo ""
2018-02-26 01:13:30 +00:00
if [[ $(conf_read force-flag) != "true" && $force != 1 ]]; then
2018-02-18 04:08:16 +00:00
echo " ${blu} Are you sure [y/N]? ${end}"
while read -r -n 1 -s answer; do
answer=${answer:-n}
2018-04-01 03:08:40 +00:00
[[ $answer = [YyNn] ]] && break
2018-02-18 04:08:16 +00:00
done
else
answer="Y"
fi
2017-09-16 20:37:13 +00:00
if [[ $answer == [Yy] ]]; then
2018-02-26 01:13:30 +00:00
conf_write force-flag true
2018-02-18 04:08:16 +00:00
[[ $force == 1 ]] && stack -nginx -purge=force || stack -nginx -purge
[[ $force == 1 ]] && stack -mysql -purge=force || stack -mysql -purge
[[ $force == 1 ]] && stack -php -purge=force || stack -php -purge
clear_force_flag
2017-09-16 20:37:13 +00:00
echo "${gre}"
echo "****************************************************************************"
2018-01-16 21:40:33 +00:00
echo "*** Webinoly Stack have been completely removed from your server ***"
echo "**** We are sad because you decided to remove Webinoly!! ****"
2017-09-16 20:37:13 +00:00
echo "****************************************************************************"
echo "${end}"
else
echo ""
echo " ${gre} Action aborted!!! ${end}"
echo ""
fi
else
echo "${red} $opt is not a valid option! ${end}"
fi
2018-02-18 04:08:16 +00:00
2018-04-01 03:08:40 +00:00
2018-02-18 04:08:16 +00:00
# Clear FORCE flag in config file
if [[ $force == 1 ]]; then
clear_force_flag
force="0"
fi