From 80ebc9d23d3bfd05160703360dbfcc01e1fe746a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 29 Aug 2019 23:37:23 +0200 Subject: [PATCH] Fix package list --- install | 4 ++-- wo/cli/plugins/stack.py | 37 +++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/install b/install index c672c18..65a395f 100755 --- a/install +++ b/install @@ -872,7 +872,7 @@ else else wo_install | tee -ai $wo_install_log fi - if [ -n "$(command -v nginx)" ]; then + if command_exists nginx; then wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log fi @@ -885,7 +885,7 @@ else wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log wo_systemd_tweak | tee -ai $wo_install_log fi - if [ -x /usr/sbin/nginx ]; then + if command_exists nginx; then wo_nginx_tweak | tee -ai $wo_install_log fi if [ -d /etc/systemd/system/mariadb.service.d ]; then diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 7197c15..cd75b94 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -858,16 +858,16 @@ class WOStackController(CementBaseController): # utils if pargs.utils: Log.debug(self, "Purge package variable utils") - packages = packages + [['{0}22222/htdocs/php/webgrind/' - .format(WOVariables.wo_webroot), - '{0}22222/htdocs/cache/opcache' - .format(WOVariables.wo_webroot), - '{0}22222/htdocs/cache/nginx/' - 'clean.php'.format(WOVariables.wo_webroot), - '/usr/bin/pt-query-advisor', - '{0}22222/htdocs/db/anemometer' - .format(WOVariables.wo_webroot) - ]] + packages = packages + ['{0}22222/htdocs/php/webgrind/' + .format(WOVariables.wo_webroot), + '{0}22222/htdocs/cache/opcache' + .format(WOVariables.wo_webroot), + '{0}22222/htdocs/cache/nginx/' + 'clean.php'.format(WOVariables.wo_webroot), + '/usr/bin/pt-query-advisor', + '{0}22222/htdocs/db/anemometer' + .format(WOVariables.wo_webroot) + ] if pargs.netdata: Log.debug(self, "Removing Netdata") @@ -897,15 +897,20 @@ class WOStackController(CementBaseController): if (set(["nginx-custom"]).issubset(set(apt_packages))): WOService.stop_service(self, 'nginx') + if (set(["fail2ban"]).issubset(set(apt_packages))): + WOService.stop_service(self, 'fail2ban') + # Netdata uninstaller if (set(['/var/lib/wo/tmp/' 'kickstart.sh']).issubset(set(packages))): - WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/" - "libexec/netdata-" - "uninstaller.sh -y -f") - - if (set(["fail2ban"]).issubset(set(apt_packages))): - WOService.stop_service(self, 'fail2ban') + if WOVariables.wo_distro == 'Raspbian': + WOShellExec.cmd_exec(self, "bash /usr/" + "libexec/netdata-" + "uninstaller.sh -y -f") + else: + WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/" + "libexec/netdata-" + "uninstaller.sh -y -f") if (apt_packages): Log.info(self, "Purging packages, please wait...")