Merge pull request #8045 from Icinga/bugfix/prepare-dirs-chmod

prepare-dirs: combine mkdir and chmod
This commit is contained in:
Noah Hilverling 2020-06-09 13:59:33 +02:00 committed by GitHub
commit b37aaa27e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -26,12 +26,10 @@ getent group $ICINGA2_GROUP >/dev/null 2>&1 || (echo "Icinga group '$ICINGA2_GRO
getent group $ICINGA2_COMMAND_GROUP >/dev/null 2>&1 || (echo "Icinga command group '$ICINGA2_COMMAND_GROUP' does not exist. Exiting." && exit 6)
if [ ! -e "$ICINGA2_INIT_RUN_DIR" ]; then
mkdir "$ICINGA2_INIT_RUN_DIR"
mkdir "$ICINGA2_INIT_RUN_DIR"/cmd
mkdir -m 755 "$ICINGA2_INIT_RUN_DIR"
mkdir -m 2750 "$ICINGA2_INIT_RUN_DIR"/cmd
fi
chmod 755 "$ICINGA2_INIT_RUN_DIR"
chmod 2750 "$ICINGA2_INIT_RUN_DIR"/cmd
chown -R $ICINGA2_USER:$ICINGA2_COMMAND_GROUP "$ICINGA2_INIT_RUN_DIR"
test -e "$ICINGA2_LOG_DIR" || install -m 750 -o $ICINGA2_USER -g $ICINGA2_COMMAND_GROUP -d "$ICINGA2_LOG_DIR"