diff --git a/usr/lib/python3.6/vmmgr/paths.py b/usr/lib/python3.6/vmmgr/paths.py index 3b921f5..d89342a 100644 --- a/usr/lib/python3.6/vmmgr/paths.py +++ b/usr/lib/python3.6/vmmgr/paths.py @@ -21,6 +21,7 @@ LXC_ROOT = '/var/lib/lxc' # OS ISSUE_FILE = '/etc/issue' +MOTD_FILE = '/etc/motd' NGINX_DIR = '/etc/nginx/conf.d' # Remote access diff --git a/usr/lib/python3.6/vmmgr/templates.py b/usr/lib/python3.6/vmmgr/templates.py index b87c179..9fa8e9c 100644 --- a/usr/lib/python3.6/vmmgr/templates.py +++ b/usr/lib/python3.6/vmmgr/templates.py @@ -88,11 +88,11 @@ server {{ ISSUE = ''' \x1b[1;32m _____ _ _ __ ____ __ - / ____| | | | | \\\\ \\\\ / / \\\\/ | - | (___ _ __ ___ | |_| |_ ___ _ _\\\\ \\\\ / /| \\\\ / | - \\\\___ \\\\| '_ \\\\ / _ \\\\| __| __/ _ \\\\ '__\\\\ \\\\/ / | |\\\\/| | - ____) | |_) | (_) | |_| || __/ | \\\\ / | | | | - |_____/| .__/ \\\\___/ \\\\__|\\\\__\\\\___|_| \\\\/ |_| |_| + / ____| | | | | \\ \\ / / \\/ | + | (___ _ __ ___ | |_| |_ ___ _ _\\ \\ / /| \\ / | + \\___ \\| '_ \\ / _ \\| __| __/ _ \\ '__\\ \\/ / | |\\/| | + ____) | |_) | (_) | |_| || __/ | \\ / | | | | + |_____/| .__/ \\___/ \\__|\\__\\___|_| \\/ |_| |_| | | |_|\x1b[0m diff --git a/usr/lib/python3.6/vmmgr/vmmgr.py b/usr/lib/python3.6/vmmgr/vmmgr.py index 7aaf01e..9165913 100644 --- a/usr/lib/python3.6/vmmgr/vmmgr.py +++ b/usr/lib/python3.6/vmmgr/vmmgr.py @@ -10,7 +10,7 @@ import urllib from . import crypto from . import templates from . import net -from .paths import ACME_CRON, ACME_DIR, ISSUE_FILE, NGINX_DIR, RELOAD_URL +from .paths import ACME_CRON, ACME_DIR, ISSUE_FILE, MOTD_FILE, NGINX_DIR, RELOAD_URL class VMMgr: def __init__(self, conf): @@ -74,9 +74,12 @@ class VMMgr: subprocess.run(['/sbin/service', 'nginx', 'restart']) def rebuild_issue(self): - # Compile the URLs displayed in terminal banner and rebuild the file + # Compile the URLs displayed in terminal banner and rebuild the issue and motd files + issue = templates.ISSUE.format(url=net.compile_url(self.domain, self.port), ip=net.compile_url(net.get_local_ip(), self.port)) with open(ISSUE_FILE, 'w') as f: - f.write(templates.ISSUE.format(url=net.compile_url(self.domain, self.port), ip=net.compile_url(net.get_local_ip(), self.port))) + f.write(issue) + with open(MOTD_FILE, 'w') as f: + f.write(issue) def update_common_settings(self, email, gmaps_api_key): # Update common configuration values