1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/bin/sh -e
action="$1"
oldversion="$2"
. /usr/share/debconf/confmodule
db_version 2.0
umask 022
if [ "$action" != configure ] ; then
exit 0
fi
# functions
setup_aprx_user() {
if ! getent passwd aprsc >/dev/null; then
echo "Creating user account: 'aprsc'"
adduser --quiet --system --no-create-home --home /var/run/aprx --shell /usr/sbin/nologin --group aprx
fi
}
fix_permissions() {
:
# chown aprx:aprx /opt/aprsc/logs /opt/aprsc/data
}
apparmor_config() {
# Reload AppArmor profile
APP_PROFILE="/etc/apparmor.d/sbin.aprx"
if [ -f "$APP_PROFILE" ] && aa-status --enabled 2>/dev/null; then
echo "Installing apparmor profile..."
apparmor_parser -r -T -W "$APP_PROFILE" || true
fi
}
# main
# setup_aprx_user
# fix_permissions
apparmor_config
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
|