From 36ef30272b6604216091428b7f471898c292cf3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Fri, 22 Jun 2018 16:23:12 -0600 Subject: [PATCH] config-load deprecated Config-Load or Custom Conf option has been deprecated. --- lib/webin | 109 ----------------------------------------------- plugins/webinoly | 4 -- weby | 11 ++--- 3 files changed, 3 insertions(+), 121 deletions(-) diff --git a/lib/webin b/lib/webin index 4a83426..5b6b6fb 100644 --- a/lib/webin +++ b/lib/webin @@ -249,115 +249,6 @@ webinoly_verify() { } -conf_load_read() { - local val=$(grep -F "${1}:" $HOME/webinoly.conf | cut -f 2 -d ':') - echo $val -} -config_load() { - webinoly -verify - if [[ $? == 1 || ! -a $HOME/webinoly.conf ]]; then - echo "${red} Configuration file not found or is corrupted! ${end}" - exit 1 - fi - - if [[ -a /opt/webinoly/webinoly.conf ]]; then - echo "${blu}" - echo " What do you want to do with your actual configuration [ P=Purge O=Overwrite C=Cancel ]? " - while read -r -n 1 -s answer; do - local answer=${answer:-n} - echo "" - if [[ $answer = [PpOoCc] ]]; then - if [[ $answer == [Pp] ]]; then - stack -purge-server-all - fi - if [[ $answer == [Oo] ]]; then - echo " Overwriting current configuration!! " - fi - if [[ $answer == [Cc] ]]; then - echo "${red} Action aborted!" - echo "${end}" - exit 1 - fi - break - fi - done - echo "${end}" - fi - - #sudo mv $HOME/webinoly.conf /opt/webinoly/ - - # Check for system variables before stack - if [[ -n $(conf_load_read swap-mem) ]]; then - conf_write swap-mem $(conf_load_read swap-mem) - fi - if [[ -n $(conf_load_read max-mb-uploads) ]]; then - conf_write max-mb-uploads $(conf_load_read max-mb-uploads) - fi - if [[ -n $(conf_load_read fd-ratio) ]]; then - conf_write fd-ratio $(conf_load_read fd-ratio) - fi - if [[ -n $(conf_load_read nginx-fd-ratio) ]]; then - conf_write nginx-fd-ratio $(conf_load_read nginx-fd-ratio) - fi - if [[ $answer == [Oo] && $(conf_read nginx-optim) == "true" ]]; then - linux_purge - linux_optim - fi - if [[ -n $(conf_load_read php-ver) ]]; then - # PHP variable version in case of Overwriting - if [[ $answer == [Oo] && $(conf_read php) == "true" && $(conf_load_read php-ver) != $(conf_read php-ver) ]]; then - conf_write force-flag true - stack -php -purge - conf_delete force-flag - fi - conf_write php-ver $(conf_load_read php-ver) - fi - - # Determine which stack install - if [[ $(conf_load_read nginx-tool) == "true" && $(conf_load_read nginx-optim) == "true" && $(conf_load_read nginx) == "true" ]]; then - stack -nginx - elif [[ $(conf_load_read nginx-tool) != "true" && $(conf_load_read nginx-optim) == "true" && $(conf_load_read nginx) == "true" ]]; then - stack -nginx -notools - fi - - if [[ $(conf_load_read php-tool) == "true" && $(conf_load_read php-optim) == "true" && $(conf_load_read php) == "true" ]]; then - stack -php - elif [[ $(conf_load_read php-tool) != "true" && $(conf_load_read php-optim) == "true" && $(conf_load_read php) == "true" ]]; then - stack -php -notools - fi - - if [[ $(conf_load_read mysql-tool) == "true" && $(conf_load_read mysql) == "true" ]]; then - stack -mysql - elif [[ $(conf_load_read mysql-tool) != "true" && $(conf_load_read mysql) == "true" ]]; then - stack -mysql -notools - fi - if [[ $(conf_load_read mysql-tool) == "true" && $(conf_read mysql-tool) != "true" ]]; then - # When pma has been purged due to php different version - stack -pma - fi - - - # Some user preferences - if [[ -n $(conf_load_read tools-port) ]]; then - webinoly -tools-port $(conf_load_read tools-port) - fi - if [[ -n $(conf_load_read fastcgi-conf) ]]; then - webinoly -config-cache $(conf_load_read fastcgi-conf) - fi - if [[ $(conf_load_read login-www-data) == "true" ]]; then - webinoly -login-www-data - fi - if [[ $(conf_load_read wp-admin-auth) == "purged" ]]; then - httpauth -wp-admin-off - fi - - echo "${gre}" - echo " Custom configuration file successfully loaded!" - echo "${end}" - -} - - system_info() { echo "${blu}" echo "[SYSTEM]" diff --git a/plugins/webinoly b/plugins/webinoly index 0a67b0c..885242d 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -243,11 +243,7 @@ elif [[ $opt == "-uninstall" ]]; then fi done - -elif [[ $opt == "-config-load" ]]; then - config_load - elif [[ $opt == "-info" ]]; then system_info diff --git a/weby b/weby index e300dbb..2db54ba 100644 --- a/weby +++ b/weby @@ -20,13 +20,12 @@ fi # Diplay menu to select type of server [[ -n "$1" ]] && setup="$1" || setup=9 -while ! [[ $setup -ge 0 && $setup -le 4 && $setup =~ ^[0-9]+$ ]] 2>/dev/null +while ! [[ $setup -ge 0 && $setup -le 3 && $setup =~ ^[0-9]+$ ]] 2>/dev/null do echo "" echo " 1 - HTML Server" echo " 2 - PHP Server" echo " 3 - LEMP Server (Default)" - echo " 4 - Custom Configuration" echo " 0 - Maybe later..." echo "" read -p "Select the desired option to configure your server: " setup @@ -85,13 +84,9 @@ conf_write app-version $webyversion # Stack installation -[[ $setup -gt 0 && $setup -lt 4 ]] && stack -nginx -[[ $setup -gt 1 && $setup -lt 4 ]] && stack -php +[[ $setup -gt 0 && $setup -lt 3 ]] && stack -nginx +[[ $setup -gt 1 && $setup -lt 3 ]] && stack -php [[ $setup == 3 ]] && stack -mysql -if [[ $setup == 4 ]]; then - source /opt/webinoly/lib/webin - config_load -fi # Message Center