summaryrefslogtreecommitdiffstats
path: root/run.d/10-print-message
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:19:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:19:10 +0000
commit5d5c58e47f1295dc437775b9e842939338ccd767 (patch)
tree07754e1307d9f8f9540b3eede439bdbe27401cb2 /run.d/10-print-message
parentInitial commit. (diff)
downloadmolly-guard-0fcf09bb693c07d24a03415a1212290fd8898ed8.tar.xz
molly-guard-0fcf09bb693c07d24a03415a1212290fd8898ed8.zip
Adding upstream version 0.7.1.upstream/0.7.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'run.d/10-print-message')
-rwxr-xr-xrun.d/10-print-message22
1 files changed, 22 insertions, 0 deletions
diff --git a/run.d/10-print-message b/run.d/10-print-message
new file mode 100755
index 0000000..0e19526
--- /dev/null
+++ b/run.d/10-print-message
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# 10-print-message - print a (command-specific or default) message
+#
+# Copyright © Andrew Ruthven <andrew@etc.gen.nz>
+# Copyright © martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Prints either /etc/molly-guard/messages.d/$MOLLYGUARD_CMD
+# or /etc/molly-guard/messages.d/default
+# depending on whether the first exists.
+#
+set -eu
+
+MESSAGESDIR=/etc/molly-guard/messages.d
+
+for i in $MOLLYGUARD_CMD default; do
+ if [ -f "$MESSAGESDIR/$i" ] && [ -r "$MESSAGESDIR/$i" ]; then
+ cat $MESSAGESDIR/$i
+ exit 0
+ fi
+done