index cc4f8a98a09399eca562e0859344cfc5b948c04b..8aa3db73fb2be2ce4716e1d26f01a754a77a6501 100644 (file)
#
# see: dh_installdeb(1)
-set -ex
+set -e
case "$1" in
configure)
abort-upgrade|abort-remove|abort-deconfigure)
;;
+ triggered)
+ /usr/sbin/update-gosa
+ exit 0
+ ;;
+
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
echo "Making /gosa available in /etc/lighttpd/conf-enabled/"
# Add GOsa include file
- ln -s /etc/gosa/99gosa-lighttpd.conf /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf
+ ln -s /etc/gosa/gosa-lighttpd.conf /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf
fi
# Finally restart servers
chown root.$WEBGROUP -R /var/cache/gosa
chmod 770 -R /var/cache/gosa
-update-gosa
+# Activating triggers
+echo DEBUG: triggertest postinst called, $# args: "$@"
+
+if [ "$1" = "configure" ]; then
+ # in the general case, update-foo and update-bar should always be called
+ # when the central package is updated
+ update-gosa
+
+elif [ "$1" = "triggered" ]; then
+ # since the example ships two triggers, we should determine how to act
+ # based on which trigger was activated.
+ for triggername in $2; do
+ echo DEBUG: processing trigger "'$triggername'"
+ case "$triggername" in
+ "/usr/share/gosa")
+ update-gosa
+ ;;
+ *)
+ echo "unhandled/unknown trigger!"
+ exit 1
+ ;;
+ esac
+ done
+fi
+
exit 0
-