Add uninstall script
This commit is contained in:
@@ -54,3 +54,4 @@ script:
|
||||
- sudo wo update --travis
|
||||
- sudo wo stack status
|
||||
- echo "yes" | sudo wo stack purge --all
|
||||
- sudo bash install --purge
|
||||
|
||||
54
install
54
install
@@ -7,7 +7,7 @@
|
||||
# Copyright (c) 2019 - WordOps
|
||||
# This script is licensed under M.I.T
|
||||
# -------------------------------------------------------------------------
|
||||
# Version 3.9.6.3 - 2019-07-25
|
||||
# Version 3.9.6.3 - 2019-07-29
|
||||
# -------------------------------------------------------------------------
|
||||
readonly wo_version_old="2.2.3"
|
||||
readonly wo_version_new="3.9.6.3"
|
||||
@@ -73,6 +73,9 @@ while [ "$#" -gt 0 ]; do
|
||||
-s | --silent)
|
||||
wo_force_install="y"
|
||||
;;
|
||||
--purge | --uninstall)
|
||||
wo_purge="y"
|
||||
;;
|
||||
*) # positional args
|
||||
;;
|
||||
esac
|
||||
@@ -620,15 +623,15 @@ wo_git_init() {
|
||||
}
|
||||
|
||||
wo_backup_ee() {
|
||||
/bin/tar -I pigz -cf "$EE_BACKUP_FILE" /etc/nginx /usr/local/bin/ee /usr/lib/ee/templates /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee /etc/letsencrypt >> /var/log/wo/install.log 2>&1
|
||||
/bin/tar -I pigz -cf "$EE_BACKUP_FILE" /etc/nginx /usr/local/bin/ee /usr/lib/ee/templates /usr/local/lib/python3.*/dist-packages/ee-*.egg /etc/ee /var/lib/ee /etc/letsencrypt >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
wo_backup_wo() {
|
||||
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /usr/local/lib/python3.6/dist-packages/wo-*.egg /etc/wo /var/lib/wo /etc/letsencrypt >> /var/log/wo/install.log 2>&1
|
||||
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /usr/local/lib/python3.*/dist-packages/wo-*.egg /etc/wo /var/lib/wo /etc/letsencrypt >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
wo_clean_ee() {
|
||||
rm -f /usr/local/bin/ee /etc/bash_completion.d/ee_auto.rc /usr/lib/ee/templates /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee >> /var/log/wo/install.log 2>&1
|
||||
rm -f /usr/local/bin/ee /etc/bash_completion.d/ee_auto.rc /usr/lib/ee/templates /usr/local/lib/python3.*/dist-packages/ee-*.egg /etc/ee /var/lib/ee >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
wo_remove_ee_cron() {
|
||||
@@ -672,12 +675,23 @@ wo_tweak_kernel() {
|
||||
|
||||
}
|
||||
|
||||
wo_uninstall() {
|
||||
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates >> /var/log/wo/install.log 2>&1
|
||||
}
|
||||
|
||||
###
|
||||
# 4 - WO MAIN SETUP
|
||||
###
|
||||
|
||||
# 1 - WO already installed
|
||||
if [ -x /usr/local/bin/wo ]; then
|
||||
if [ $wo_purge = "y" ]; then
|
||||
wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log
|
||||
wo_backup_wo | tee -ai $wo_install_log
|
||||
wo_lib_echo "Uninstalling WordOps" | tee -ai $wo_install_log
|
||||
wo_uninstall | tee -ai $wo_install_log
|
||||
wo_lib_echo "The WordOps backup files can be found in $WO_BACKUP_FILE"
|
||||
else
|
||||
# 1 - WO already installed
|
||||
if [ -x /usr/local/bin/wo ]; then
|
||||
if ! {
|
||||
wo -v 2>&1 | grep $wo_version_new
|
||||
} || [ "$wo_force_install" = "y" ]; then
|
||||
@@ -720,7 +734,7 @@ if [ -x /usr/local/bin/wo ]; then
|
||||
else
|
||||
wo_lib_error "You already have WordOps $wo_version_new, exit status = " 1
|
||||
fi
|
||||
else
|
||||
else
|
||||
# 2 - Migration from EEv3
|
||||
if [ -x /usr/local/bin/ee ]; then
|
||||
if [ -z "$wo_force_install" ]; then
|
||||
@@ -776,24 +790,26 @@ else
|
||||
wo_git_init | tee -ai $wo_install_log
|
||||
wo_update_wp_cli | tee -ai $wo_install_log
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
wo sync | tee -ai $wo_install_log
|
||||
wo sync | tee -ai $wo_install_log
|
||||
|
||||
if [ "$ee_migration" = "1" ]; then
|
||||
if [ "$ee_migration" = "1" ]; then
|
||||
echo
|
||||
wo_lib_echo "The migration from EasyEngine to WordOps was succesfull!"
|
||||
wo_lib_echo "The EasyEngine backup files can be found in /var/lib/wo-backup/ee-backup.tgz"
|
||||
echo
|
||||
elif [ "$wo_upgrade" = "1" ]; then
|
||||
elif [ "$wo_upgrade" = "1" ]; then
|
||||
wo_lib_echo "WordOps (wo) upgrade to $wo_version_new was succesfull!"
|
||||
else
|
||||
else
|
||||
wo_lib_echo "WordOps (wo) installed successfully"
|
||||
fi
|
||||
echo
|
||||
wo_lib_echo_info "For autocompletion, run the following command:"
|
||||
wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc"
|
||||
echo
|
||||
wo_lib_echo "WordOps Documentation : https://docs.wordops.net"
|
||||
wo_lib_echo "WordOps Community Forum : https://community.wordops.net"
|
||||
echo
|
||||
|
||||
fi
|
||||
echo
|
||||
wo_lib_echo_info "For autocompletion, run the following command:"
|
||||
wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc"
|
||||
echo
|
||||
wo_lib_echo "WordOps Documentation : https://docs.wordops.net"
|
||||
wo_lib_echo "WordOps Community Forum : https://community.wordops.net"
|
||||
echo
|
||||
|
||||
@@ -1486,6 +1486,7 @@ class WOStackController(CementBaseController):
|
||||
"/master/mysqltuner.pl",
|
||||
"/usr/bin/mysqltuner",
|
||||
"MySQLTuner"]]
|
||||
|
||||
else:
|
||||
Log.debug(self, "MySQL connection is already alive")
|
||||
Log.info(self, "MySQL connection is already alive")
|
||||
|
||||
Reference in New Issue
Block a user