summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2021-12-19 11:10:47 +0700
committerDaniil Baturin <daniil@baturin.org>2021-12-19 11:10:47 +0700
commit4957ef1bd8f1f0bf0b4828e7fadb64d1bac0bd2d (patch)
tree17f1c6518133f1f131bcc697ebea5835eeb88436
parentda3e558992df5f155083e4b0fe9645381d8b2cd1 (diff)
downloadvyos-1x-4957ef1bd8f1f0bf0b4828e7fadb64d1bac0bd2d.tar.gz
vyos-1x-4957ef1bd8f1f0bf0b4828e7fadb64d1bac0bd2d.zip
T4084: dehardcode the post-login banner
-rwxr-xr-xsrc/conf_mode/system-login-banner.py18
1 files changed, 6 insertions, 12 deletions
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'