reinstall process improved

Now we save a copy of config-file in home folder in case Webinoly is reinstalled.
This commit is contained in:
Cristhian Martínez Ochoa 2018-01-16 18:10:22 -07:00
parent a54d357a20
commit 9d97bf93cc
2 changed files with 12 additions and 7 deletions

View file

@ -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

18
weby
View file

@ -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