Fix wo stack install --all

This commit is contained in:
VirtuBox
2019-08-29 18:45:37 +02:00
parent 9b7291d04f
commit 09fa78b92a

View File

@@ -124,8 +124,8 @@ class WOStackController(CementBaseController):
(not pargs.mysql) and (not pargs.wpcli) and (not pargs.mysql) and (not pargs.wpcli) and
(not pargs.phpmyadmin) and (not pargs.composer) and (not pargs.phpmyadmin) and (not pargs.composer) and
(not pargs.netdata) and (not pargs.dashboard) and (not pargs.netdata) and (not pargs.dashboard) and
(not pargs.fail2ban) and (not pargs.security) (not pargs.fail2ban) and (not pargs.security) and
and (not pargs.mysqlclient) and (not pargs.mysqltuner) and (not pargs.mysqlclient) and (not pargs.mysqltuner) and
(not pargs.adminer) and (not pargs.utils) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.redis) and (not pargs.proftpd) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.extplorer) and (not pargs.extplorer) and
@@ -308,8 +308,8 @@ class WOStackController(CementBaseController):
Log.info(self, "phpRedisAdmin already installed") Log.info(self, "phpRedisAdmin already installed")
# Composer # Composer
if (pargs.composer and not if pargs.composer and (not
os.path.isfile('/usr/local/bin/composer')): os.path.isfile('/usr/local/bin/composer')):
Log.debug(self, "Setting packages variable for Composer ") Log.debug(self, "Setting packages variable for Composer ")
packages = packages + [["https://getcomposer.org/" packages = packages + [["https://getcomposer.org/"
"installer", "installer",
@@ -320,9 +320,10 @@ class WOStackController(CementBaseController):
Log.info(self, "Composer already installed") Log.info(self, "Composer already installed")
# ADMINER # ADMINER
if (pargs.adminer and not if pargs.adminer and (not
os.path.isfile("{0}22222/htdocs/db/adminer/index.php" os.path.isfile("{0}22222/htdocs/db/"
.format(wo_webroot))): "adminer/index.php"
.format(wo_webroot))):
Log.debug(self, "Setting packages variable for Adminer ") Log.debug(self, "Setting packages variable for Adminer ")
packages = packages + [["https://github.com/vrana/adminer/" packages = packages + [["https://github.com/vrana/adminer/"
"releases/download/v{0}" "releases/download/v{0}"
@@ -340,8 +341,8 @@ class WOStackController(CementBaseController):
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
"Adminer theme"]] "Adminer theme"]]
# mysqltuner # mysqltuner
if (pargs.mysqltuner and not if pargs.mysqltuner and (not
os.path.isfile("/usr/bin/mysqltuner")): os.path.isfile("/usr/bin/mysqltuner")):
Log.debug(self, "Setting packages variable for MySQLTuner ") Log.debug(self, "Setting packages variable for MySQLTuner ")
packages = packages + [["https://raw." packages = packages + [["https://raw."
"githubusercontent.com/" "githubusercontent.com/"
@@ -351,9 +352,9 @@ class WOStackController(CementBaseController):
"MySQLTuner"]] "MySQLTuner"]]
# Netdata # Netdata
if (pargs.netdata and if pargs.netdata and (
(not os.path.isdir('/opt/netdata') and not not os.path.isdir('/opt/netdata') and not
os.path.isdir("/etc/netdata"))): os.path.isdir("/etc/netdata")):
Log.debug(self, "Setting packages variable for Netdata") Log.debug(self, "Setting packages variable for Netdata")
if WOVariables.wo_distro == 'raspbian': if WOVariables.wo_distro == 'raspbian':
packages = packages + [['https://my-netdata.io/' packages = packages + [['https://my-netdata.io/'
@@ -446,33 +447,34 @@ class WOStackController(CementBaseController):
Log.debug(self, "Setting packages variable for cht.sh") Log.debug(self, "Setting packages variable for cht.sh")
packages = packages + [["https://cht.sh/:cht.sh", packages = packages + [["https://cht.sh/:cht.sh",
"/usr/local/bin/cht.sh", "/usr/local/bin/cht.sh",
"cht.sh"]] "cheat.sh"]]
else: else:
Log.debug(self, "cht.sh is already installed") Log.debug(self, "cht.sh is already installed")
Log.info(self, "cht.sh is already installed") Log.info(self, "cheat.sh is already installed")
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e)) Log.debug(self, "{0}".format(e))
if (apt_packages): if (apt_packages) or (packages):
Log.debug(self, "Calling pre_pref") if (apt_packages):
pre_pref(self, apt_packages) Log.debug(self, "Calling pre_pref")
# meminfo = (os.popen('/bin/cat /proc/meminfo ' pre_pref(self, apt_packages)
# '| grep MemTotal').read()).split(":") # meminfo = (os.popen('/bin/cat /proc/meminfo '
# memsplit = re.split(" kB", meminfo[1]) # '| grep MemTotal').read()).split(":")
# wo_mem = int(memsplit[0]) # memsplit = re.split(" kB", meminfo[1])
# if (wo_mem < 4000000): # wo_mem = int(memsplit[0])
# WOSwap.add(self) # if (wo_mem < 4000000):
Log.info(self, "Updating apt-cache, please wait...") # WOSwap.add(self)
WOAptGet.update(self) Log.info(self, "Updating apt-cache, please wait...")
Log.info(self, "Installing packages, please wait...") WOAptGet.update(self)
WOAptGet.install(self, apt_packages) Log.info(self, "Installing packages, please wait...")
post_pref(self, apt_packages, empty_packages) WOAptGet.install(self, apt_packages)
if (packages): post_pref(self, apt_packages, empty_packages)
Log.debug(self, "Downloading following: {0}".format(packages)) if (packages):
WODownload.download(self, packages) Log.debug(self, "Downloading following: {0}".format(packages))
Log.debug(self, "Calling post_pref") WODownload.download(self, packages)
post_pref(self, empty_packages, packages) Log.debug(self, "Calling post_pref")
post_pref(self, empty_packages, packages)
if disp_msg: if disp_msg:
if (self.msg): if (self.msg):
@@ -490,15 +492,17 @@ class WOStackController(CementBaseController):
pargs = self.app.pargs pargs = self.app.pargs
if ((not pargs.web) and (not pargs.admin) and if ((not pargs.web) and (not pargs.admin) and
(not pargs.nginx) and (not pargs.php) and (not pargs.nginx) and (not pargs.php) and
(not pargs.php73) and (not pargs.mysql) and (not pargs.mysql) and (not pargs.wpcli) and
(not pargs.wpcli) and (not pargs.phpmyadmin) and (not pargs.phpmyadmin) and (not pargs.composer) and
(not pargs.adminer) and (not pargs.utils) and (not pargs.netdata) and (not pargs.dashboard) and
(not pargs.composer) and (not pargs.netdata) and (not pargs.fail2ban) and (not pargs.security) and
(not pargs.fail2ban) and (not pargs.proftpd) and (not pargs.mysqlclient) and (not pargs.mysqltuner) and
(not pargs.security) and (not pargs.mysqltuner) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.mysqlclient) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.all) and (not pargs.redis) and (not pargs.extplorer) and
(not pargs.phpredisadmin)): (not pargs.cheat) and (not pargs.clamav) and
(not pargs.phpredisadmin) and
(not pargs.php73)):
pargs.web = True pargs.web = True
pargs.admin = True pargs.admin = True
pargs.security = True pargs.security = True
@@ -676,15 +680,17 @@ class WOStackController(CementBaseController):
# Default action for stack purge # Default action for stack purge
if ((not pargs.web) and (not pargs.admin) and if ((not pargs.web) and (not pargs.admin) and
(not pargs.nginx) and (not pargs.php) and (not pargs.nginx) and (not pargs.php) and
(not pargs.php73) and (not pargs.mysql) and (not pargs.mysql) and (not pargs.wpcli) and
(not pargs.wpcli) and (not pargs.phpmyadmin) and (not pargs.phpmyadmin) and (not pargs.composer) and
(not pargs.adminer) and (not pargs.utils) and (not pargs.netdata) and (not pargs.dashboard) and
(not pargs.composer) and (not pargs.netdata) and (not pargs.fail2ban) and (not pargs.security) and
(not pargs.fail2ban) and (not pargs.proftpd) and (not pargs.mysqlclient) and (not pargs.mysqltuner) and
(not pargs.security) and (not pargs.mysqltuner) and (not pargs.adminer) and (not pargs.utils) and
(not pargs.mysqlclient) and (not pargs.redis) and (not pargs.proftpd) and
(not pargs.all) and (not pargs.redis) and (not pargs.extplorer) and
(not pargs.phpredisadmin)): (not pargs.cheat) and (not pargs.clamav) and
(not pargs.phpredisadmin) and
(not pargs.php73)):
pargs.web = True pargs.web = True
pargs.admin = True pargs.admin = True
pargs.security = True pargs.security = True