Fix package install

This commit is contained in:
VirtuBox
2019-08-26 18:59:06 +02:00
parent a4c48c10bd
commit b703388b30
3 changed files with 29 additions and 27 deletions

21
install
View File

@@ -695,7 +695,6 @@ wo_mariadb_tweak() {
wo_nginx_tweak() {
# increase nginx open_files_limit
{
if [ -x /usr/sbin/nginx ]; then
if [ ! -d /etc/systemd/system/nginx.service.d ]; then
mkdir -p /etc/systemd/system/nginx.service.d
if [ ! -f /etc/systemd/system/nginx.service.d/limits.conf ]; then
@@ -704,7 +703,6 @@ wo_nginx_tweak() {
nginx -t && service nginx restart
fi
fi
fi
} >> /var/log/wo/install.log 2>&1
}
@@ -824,8 +822,13 @@ else
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
wo_systemd_tweak | tee -ai $wo_install_log
fi
wo_nginx_tweak | tee -ai $wo_install_log
wo_mysql_tweak | tee -ai $wo_install_log
if [ -x /usr/sbin/nginx ]; then
wo_nginx_tweak | tee -ai $wo_install_log
fi
if [ -d /etc/systemd/system/mariadb.service.d ]; then
wo_mariadb_tweak | tee -ai $wo_install_log
fi
wo_domain_suffix | tee -ai $wo_install_log
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
wo_update_wp_cli | tee -ai $wo_install_log
else
@@ -868,8 +871,13 @@ else
wo_lib_echo "Adding systemd service tweak" | tee -ai $wo_install_log
wo_systemd_tweak | tee -ai $wo_install_log
fi
wo_nginx_tweak | tee -ai $wo_install_log
wo_mysql_tweak | tee -ai $wo_install_log
if [ -x /usr/sbin/nginx ]; then
wo_nginx_tweak | tee -ai $wo_install_log
fi
if [ -d /etc/systemd/system/mariadb.service.d ]; then
wo_mariadb_tweak | tee -ai $wo_install_log
fi
wo_domain_suffix | tee -ai $wo_install_log
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
wo_git_init | tee -ai $wo_install_log
wo_update_wp_cli | tee -ai $wo_install_log
@@ -907,6 +915,7 @@ else
wo_install_acme_sh | tee -ai $wo_install_log
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
secure_wo_db | tee -ai $wo_install_log
wo_domain_suffix | tee -ai $wo_install_log
wo_git_init | tee -ai $wo_install_log
wo_update_wp_cli | tee -ai $wo_install_log
fi

View File

@@ -128,7 +128,7 @@ class WOStackController(CementBaseController):
and (not pargs.mysqlclient) and (not pargs.mysqltuner) and
(not pargs.adminer) and (not pargs.utils) and
(not pargs.redis) and (not pargs.proftpd) and
(not pargs.extplorer) and (not pargs.mariabackup) and
(not pargs.extplorer) and
(not pargs.cheat) and (not pargs.clamav) and
(not pargs.phpredisadmin) and
(not pargs.php73)):
@@ -149,7 +149,6 @@ class WOStackController(CementBaseController):
pargs.php = True
pargs.mysql = True
pargs.wpcli = True
pargs.mariabackup = True
if pargs.admin:
pargs.web = True
@@ -186,14 +185,14 @@ class WOStackController(CementBaseController):
if WOAptGet.is_installed(self, 'nginx-plus'):
Log.info(self, "NGINX PLUS Detected ...")
apt = ["nginx-plus"] + WOVariables.wo_nginx
self.post_pref(apt, packages)
self.post_pref(apt, empty_packages)
elif WOAptGet.is_installed(self, 'nginx'):
Log.info(self, "WordOps detected an already "
"installed nginx package."
"It may or may not have "
"required modules.\n")
apt = ["nginx"] + WOVariables.wo_nginx
self.post_pref(apt, packages)
self.post_pref(apt, empty_packages)
else:
Log.debug(self, "Nginx Stable already installed")
@@ -225,7 +224,6 @@ class WOStackController(CementBaseController):
# MariaDB 10.3
if pargs.mysql:
pargs.mariabackup = True
pargs.mysqltuner = True
Log.debug(self, "Setting apt_packages variable for MySQL")
if not WOShellExec.cmd_exec(self, "mysqladmin ping"):
@@ -237,13 +235,6 @@ class WOStackController(CementBaseController):
"for MySQL Client")
apt_packages = apt_packages + WOVariables.wo_mysql_client
# mariabackup
if pargs.mariabackup:
if not WOAptGet.is_installed(self, 'mariadb-backup'):
Log.debug(self, "Setting apt_packages variable "
"for MariaBackup")
apt_packages = apt_packages + ["mariadb-backup"]
# WP-CLI
if pargs.wpcli:
Log.debug(self, "Setting packages variable for WP-CLI")
@@ -270,11 +261,11 @@ class WOStackController(CementBaseController):
# ClamAV
if pargs.clamav:
Log.debug(self, "Setting apt_packages variable for ClamAV")
if not WOAptGet.is_installed(self, 'fail2ban'):
if not WOAptGet.is_installed(self, 'clamav'):
apt_packages = apt_packages + ["clamav"]
else:
Log.debug(self, "Fail2ban already installed")
Log.info(self, "Fail2ban already installed")
Log.debug(self, "ClamAV already installed")
Log.info(self, "ClamAV already installed")
# proftpd
if pargs.proftpd:
@@ -383,7 +374,8 @@ class WOStackController(CementBaseController):
Log.debug(self, "WordOps dashboard already installed")
Log.info(self, "WordOps dashboard already installed")
if pargs.dashboard:
# eXtplorer
if pargs.explorer:
if not os.path.isdir('/var/www/22222/htdocs/files'):
Log.debug(self, "Setting packages variable for eXtplorer")
packages = packages + \
@@ -442,9 +434,9 @@ class WOStackController(CementBaseController):
if (not os.path.isfile('/usr/local/bin/cht.sh') and
not os.path.isfile('/usr/bin/cht.sh')):
Log.debug(self, "Setting packages variable for cht.sh")
[["https://cht.sh/:cht.sh",
"/usr/local/bin/cht.sh",
"Cht.sh"]]
packages = packages + [["https://cht.sh/:cht.sh",
"/usr/local/bin/cht.sh",
"cht.sh"]]
else:
Log.debug(self, "cht.sh is already installed")
Log.info(self, "cht.sh is already installed")

View File

@@ -10,7 +10,7 @@ class WOVariables():
"""Intialization of core variables"""
# WordOps version
wo_version = "3.9.8.3"
wo_version = "3.9.8.4"
# WordOps packages versions
wo_wp_cli = "2.2.0"
wo_adminer = "4.7.2"
@@ -143,7 +143,8 @@ class WOVariables():
"10.3/debian {codename} main"
.format(codename=wo_platform_codename))
wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb"]
wo_mysql = ["mariadb-server", "percona-toolkit",
"python3-mysqldb", "mariadb-backup"]
wo_mysql_client = ["mariadb-client", "python3-mysqldb"]