summaryrefslogtreecommitdiffstats
path: root/debian/freeradius.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:11:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:11:04 +0000
commita31a6484b79cf48b4b464a6ab84df3361801076e (patch)
treea7c33f7023721122d1f49ab1dffdc2cd6a8481a5 /debian/freeradius.postinst
parentAdding upstream version 3.2.3+dfsg. (diff)
downloadfreeradius-a31a6484b79cf48b4b464a6ab84df3361801076e.tar.xz
freeradius-a31a6484b79cf48b4b464a6ab84df3361801076e.zip
Adding debian version 3.2.3+dfsg-2.debian/3.2.3+dfsg-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/freeradius.postinst')
-rw-r--r--debian/freeradius.postinst69
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/freeradius.postinst b/debian/freeradius.postinst
new file mode 100644
index 0000000..b1f853f
--- /dev/null
+++ b/debian/freeradius.postinst
@@ -0,0 +1,69 @@
+#!/bin/sh
+# vim:ts=2:sw=2:et
+
+set -e
+
+case "$1" in
+ configure)
+ if [ -z "$2" ]; then
+ # Changed in 1.1.5-1 for new installs (we used to start at S50
+ # and stop at K50) We now start at S50 and stop at K19 so we
+ # start after services which may be used and stop before them.
+ update-rc.d freeradius start 50 2 3 4 5 . stop 19 0 1 6 . >/dev/null
+
+ for file in radius.log radwtmp; do
+ [ ! -f "/var/log/freeradius/${file}" ] && install -o freerad -g freerad -m 644 /dev/null /var/log/freeradius/${file}
+ done
+
+ action="start"
+ else
+ action="restart"
+ fi
+
+ if [ -z "$2" ]; then
+ # Set up initial permissions on all the freeradius directories
+ chown -R freerad:adm /var/log/freeradius
+ chown -R freerad:freerad /etc/freeradius
+ chmod 2750 /etc/freeradius
+ find /etc/freeradius -type f -exec chmod 640 '{}' \;
+ fi
+
+ if dpkg --compare-versions "$2" lt 3.0.16+dfsg-3; then
+ chmod 2750 /etc/freeradius
+ fi
+
+ # Create links for default sites, but only if this is an initial
+ # install or an upgrade from before there were links; users may
+ # want to remove them...
+ if [ -z "$2" ]; then
+ for site in default inner-tunnel; do
+ if test ! -h /etc/freeradius/3.0/sites-enabled/$site && \
+ test ! -e /etc/freeradius/3.0/sites-enabled/$site; then
+ ln -s ../sites-available/$site /etc/freeradius/3.0/sites-enabled/$site
+ fi
+ done
+ fi
+
+ invoke-rc.d freeradius $action || true
+ ;;
+
+ abort-upgrade)
+ invoke-rc.d freeradius restart || true
+ ;;
+
+ abort-remove)
+ invoke-rc.d freeradius start || true
+ ;;
+esac
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+ # After removing conffiles (in the DEBHELPER part above), delete all
+ # directories underneath /etc/freeradius which are now empty.
+ find /etc/freeradius -type d -empty -delete
+ ;;
+esac
+
+exit 0