Debian Codegraph @

debian/dmarcts-report-parser.cronjob

raw
1 #!/bin/bash
2
3 DMARCTS_USER="_dmarcts"
4 DMARCTS_PARSER_OPTIONS=""
5
6 if [ -e "/etc/default/dmarcts-report-parser" ]; then
7 . /etc/default/dmarcts-report-parser
8 else
9 echo "$(basename $0): /etc/default/dmarcts-report-parser, report parser probably not configured?" 1>&2
10 exit 1
11 fi
12
13 if [ "$IS_CONFIGURED" != "1" ]; then
14 echo "$(basename $0): /etc/default/dmarcts-report-parser found, but IS_CONFIGURED not set to '1'. Not configured, yet?" 1>&2
15 exit 1
16 fi
17
18 if ! getent passwd "$DMARCTS_USER" 1>/dev/null; then
19 echo "$(basename $0): /etc/default/dmarcts-report-parser found, but DMARCTS_USER not found. Not configured, yet?" 1>&2
20 exit 1
21 fi
22
23 su -s /bin/sh - "$DMARCTS_USER" -c "/usr/sbin/dmarcts-report-parser $DMARCTS_PARSER_OPTIONS"