From 9d97bf93cc73418595df0174b5e03db3da7ff6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Mart=C3=ADnez=20Ochoa?= Date: Tue, 16 Jan 2018 18:10:22 -0700 Subject: [PATCH] reinstall process improved Now we save a copy of config-file in home folder in case Webinoly is reinstalled. --- plugins/webinoly | 1 + weby | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/webinoly b/plugins/webinoly index 869b2ad..84cf407 100644 --- a/plugins/webinoly +++ b/plugins/webinoly @@ -204,6 +204,7 @@ elif [ "$opt" == "-uninstall" ]; then sudo apt-get -y -qq autoremove > /dev/null conf_write pre-packs purged fi + sudo mv /opt/webinoly/webinoly.conf $HOME/.webinoly-conf-restore_dont-remove sudo rm -rf /opt/webinoly sudo rm /usr/bin/webinoly sudo rm /usr/bin/stack diff --git a/weby b/weby index d1e8fab..6022ac5 100644 --- a/weby +++ b/weby @@ -2,7 +2,7 @@ # Webinoly script. # This script is designed to install latest Webinoly. -webyversion="1.2.2-beta" +webyversion="1.2.2" # Check OS support @@ -64,15 +64,19 @@ sudo mv /opt/webinoly/plugins/* /usr/bin/ source /opt/webinoly/lib/install -# Save Tools Port after library is available. -if [[ -z "$2" ]]; then - portools="22222" -else - portools="$2" +# Check for uninstalled Webinoly conf file +if [[ -a $HOME/.webinoly-conf-restore_dont-remove ]]; then + sudo mv $HOME/.webinoly-conf-restore_dont-remove /opt/webinoly/webinoly.conf fi -if [[ -a /opt/webinoly/webinoly.conf ]]; then + +# Save Tools Port after library is available. +if [[ -a /opt/webinoly/webinoly.conf && -n $(conf_read tools-port) ]]; then echo "${gre}Webinoly Configuration file was found, so we will use it!${end}" else + portools="22222" + if [[ -n "$2" ]]; then + portools="$2" + fi tools_port $portools fi