Fix invirt-base's handling of triggers.
[invirt/packages/invirt-base.git] / scripts / invirt-reload
1 #!/bin/bash
2
3 if [ x"$INVIRT_RELOAD_NOTRIGGER" = x ] && \
4     [ "$DPKG_MAINTSCRIPT_PACKAGE" != '' ] && \
5     [ $# = 0 ] && \
6     dpkg-trigger --check-supported 2>/dev/null; then
7     if dpkg-trigger --no-await invirt-reload; then
8         echo "invirt-reload: deferring update (trigger activated)"
9         exit 0
10     fi
11 fi
12
13 for script in $(run-parts --test /etc/init.d); do
14     if [ "${script#/etc/init.d/invirt-}" != "$script" ]; then
15         invoke-rc.d "${script#/etc/init.d/}" force-reload
16     fi
17 done