update nginx, set wan interface for wo dashboard

This commit is contained in:
VirtuBox
2019-04-24 02:01:50 +02:00
parent 51963091a4
commit 78fd8bbb44
5 changed files with 19 additions and 3 deletions

View File

@@ -1135,6 +1135,12 @@ class WOStackController(CementBaseController):
WOExtract.extract(self, '/tmp/wo-dashboard.tar.gz',
'{0}22222/htdocs'
.format(WOVariables.wo_webroot))
if WOVariables.wo_wan_interface != 'eth0':
WOFileUtils.searchreplace(self, "{0}22222/htdocs/index.php"
.format(WOVariables.wo_webroot),
"eth0",
"{0}".format(WOVariables.wo_wan_interface))
Log.debug(self, "Setting Privileges to "
"{0}22222/htdocs"
.format(WOVariables.wo_webroot))

View File

@@ -22,6 +22,13 @@ class WOVariables():
if wo_wpcli_path == '':
wo_wpcli_path = '/usr/local/bin/wp '
# get wan network interface name
wo_wan_interface = os.popen("ip -4 route get 8.8.8.8 | "
"grep -oP \"dev [^[:space:]]+ \" "
"| cut -d ' ' -f 2").read()
if wo_wan_interface == '':
wo_wan_interface = 'eth0'
# Current date and time of System
wo_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')