Files
fail2ban-p2p/debian/postinst
2026-04-22 23:24:29 +02:00

35 lines
886 B
Bash
Executable File

#!/bin/sh
set -e
PACKAGE=fail2ban-p2p
SERVER_USER=${SERVER_USER:-fail2ban-p2p}
SERVER_GROUP=${SERVER_GROUP:-fail2ban-p2p}
SERVER_HOME=${SERVER_HOME:-/var/lib/fail2ban-p2p}
LOGFILE=/var/log/fail2ban-p2p.log
CONFDIR=/etc/fail2ban-p2p
case "$1" in
configure)
install -d -o "$SERVER_USER" -g "$SERVER_GROUP" -m 0750 "$SERVER_HOME"
if [ -d "$CONFDIR" ]; then
chgrp "$SERVER_GROUP" "$CONFDIR" || true
chmod 0750 "$CONFDIR" || true
find "$CONFDIR" -type d -exec chmod 0750 {} \; || true
fi
if [ -f "$LOGFILE" ]; then
chown "$SERVER_USER":adm "$LOGFILE" || true
chmod 0640 "$LOGFILE" || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0