aboutsummaryrefslogtreecommitdiffstats
path: root/gotrc-examples/issue-file
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-01-08 12:48:55 +0100
committerMattias Andrée <maandree@operamail.com>2015-01-08 12:48:55 +0100
commit529c9e4c731543ce7038aa7e45e5de0fb93f8e58 (patch)
tree62a2e8d286d45e08abcb7785077527d4c9c12a37 /gotrc-examples/issue-file
parenthow could I forget the copyright notice (diff)
downloadgates-of-tartaros-529c9e4c731543ce7038aa7e45e5de0fb93f8e58.tar.gz
gates-of-tartaros-529c9e4c731543ce7038aa7e45e5de0fb93f8e58.tar.bz2
gates-of-tartaros-529c9e4c731543ce7038aa7e45e5de0fb93f8e58.tar.xz
/etc/issue can be supressed if it has not been changed by the initsystem
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'gotrc-examples/issue-file')
-rw-r--r--gotrc-examples/issue-file8
1 files changed, 5 insertions, 3 deletions
diff --git a/gotrc-examples/issue-file b/gotrc-examples/issue-file
index 39d7144..c2b8bef 100644
--- a/gotrc-examples/issue-file
+++ b/gotrc-examples/issue-file
@@ -24,7 +24,8 @@
_display ()
{
- python3 <<EOF
+ if [ ! -f "/etc/issue.default" ] || [ ! "$(md5sum < "/etc/issue.default")" = "$(md5sum < "/etc/issue")" ]; then
+ python3 <<EOF
buf = "\\033[H\\033[2J"
data = None
with open("/etc/issue", "rb") as f:
@@ -59,7 +60,8 @@ for c in data:
buf += c
print(buf, end = "", flush = True)
EOF
- echo
- echo -n 'Login: '
+ echo
+ echo -n 'Login: '
+ fi
}