Previously a module that was removed (not purged) and then reinstalled did not enable itself causing some confusion. Now, we maintain state by moving the module symlink to .removed on package removal. If the package is reinstalled the link is restored, if purged the link is completely dropped.
28 lines
738 B
Text
28 lines
738 B
Text
if [ "$1" = "purge" ] ; then
|
|
for confpair in #NAMES# ; do
|
|
from=$(echo $confpair | cut -d: -f1)
|
|
to=$(echo $confpair | cut -d: -f2)
|
|
|
|
if [ -L /etc/nginx/modules-enabled/$to ]; then
|
|
rm /etc/nginx/modules-enabled/$to
|
|
fi
|
|
if [ -L /etc/nginx/modules-enabled/$to.removed ]; then
|
|
rm /etc/nginx/modules-enabled/$to.removed
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [ "$1" = "remove" ] ; then
|
|
for confpair in #NAMES# ; do
|
|
from=$(echo $confpair | cut -d: -f1)
|
|
to=$(echo $confpair | cut -d: -f2)
|
|
|
|
if [ -L /etc/nginx/modules-enabled/$to ]; then
|
|
mv /etc/nginx/modules-enabled/$to /etc/nginx/modules-enabled/$to.removed
|
|
fi
|
|
done
|
|
|
|
if which dpkg-trigger >/dev/null 2>&1 ; then
|
|
dpkg-trigger --no-await nginx-reload
|
|
fi
|
|
fi
|