diff --git a/class/core/common.py b/class/core/common.py index c8da7c337..779c22a3c 100755 --- a/class/core/common.py +++ b/class/core/common.py @@ -62,6 +62,8 @@ def initInitD(): mw.writeFile(script_bin, content) mw.execShell('chmod +x ' + script_bin) + mw.setHostAddr(mw.getLocalIp()) + if not mw.isAppleSystem(): initd_bin = '/etc/init.d/mw' if not os.path.exists(initd_bin): diff --git a/class/core/config_api.py b/class/core/config_api.py index 525b1de13..0d0ee267b 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -264,7 +264,7 @@ class config_api: key.generate_key(OpenSSL.crypto.TYPE_RSA, 2048) cert = OpenSSL.crypto.X509() cert.set_serial_number(0) - cert.get_subject().CN = '120.27.27.98' + cert.get_subject().CN = mw.getLocalIp() cert.set_issuer(cert.get_subject()) cert.gmtime_adj_notBefore(0) cert.gmtime_adj_notAfter(86400 * 3650)