From 4957ef1bd8f1f0bf0b4828e7fadb64d1bac0bd2d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 19 Dec 2021 11:10:47 +0700 Subject: T4084: dehardcode the post-login banner --- src/conf_mode/system-login-banner.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/conf_mode/system-login-banner.py') diff --git a/src/conf_mode/system-login-banner.py b/src/conf_mode/system-login-banner.py index 9642b2aae..84ff08ebf 100755 --- a/src/conf_mode/system-login-banner.py +++ b/src/conf_mode/system-login-banner.py @@ -22,18 +22,12 @@ from vyos import ConfigError from vyos import airbag airbag.enable() -motd=""" -Welcome to VyOS - -Check out project news at https://blog.vyos.io -and feel free to report bugs at https://phabricator.vyos.net - -You can change this banner using "set system login banner post-login" command. - -VyOS is a free software distribution that includes multiple components, -you can check individual component licenses under /usr/share/doc/*/copyright - -""" +try: + with open('/usr/share/vyos/default_motd') as f: + motd = f.read() +except: + # Use an empty banner if the default banner file cannot be read + motd = "\n" PRELOGIN_FILE = r'/etc/issue' PRELOGIN_NET_FILE = r'/etc/issue.net' -- cgit v1.2.3