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:21:08 +0700
commit0e484072419392ea6a5568145a3c60f84d937e23 (patch)
tree57ca79dab26421bfced649ffae0456c38754f010
parente671c4b33157836e73a3efc91e691215bc5b144b (diff)
downloadvyos-1x-0e484072419392ea6a5568145a3c60f84d937e23.tar.gz
vyos-1x-0e484072419392ea6a5568145a3c60f84d937e23.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'