File: 10-print-message

package info (click to toggle)
molly-guard 0.6.4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 88 kB
  • ctags: 11
  • sloc: xml: 286; sh: 203; makefile: 41
file content (22 lines) | stat: -rwxr-xr-x 593 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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