From a566736e62ebca8a0e93c5c07c3c07cceded9826 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Feb 2015 16:26:17 +0100 Subject: Bump --- scripts/ldadp-setperms | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 scripts/ldadp-setperms (limited to 'scripts/ldadp-setperms') diff --git a/scripts/ldadp-setperms b/scripts/ldadp-setperms new file mode 100755 index 0000000..2c6ea08 --- /dev/null +++ b/scripts/ldadp-setperms @@ -0,0 +1,19 @@ +#!/bin/bash + +BASE="/opt/ldadp/configs" + +[ -z "$1" ] && exit 11 +echo "$1" | grep -q -E '^[0-9]+$' || exit 12 + +FILE="${BASE}/${1}" + +[ -e "${FILE}.cfg" ] || exit 9 +[ -e "${FILE}.crt.pem" ] || exit 8 +[ -e "${FILE}.key.pem" ] || exit 7 + +for ext in cfg crt.pem key.pem; do + file="${FILE}.${ext}" + /bin/chown taskmanager:ldadp "$file" || exit 6 + /bin/chmod 0640 "$file" || exit 5 +done + -- cgit v1.2.3-55-g7522