source: trunk/packages/invirt-base/scripts/invirt-reload @ 2963

Last change on this file since 2963 was 2941, checked in by broder, 15 years ago

Add code to invirt-reload to de-duplicate multiple invocations. (LP: #439426)

This uses the dpkg triggers mechanism to de-duplicate multiple
invocations of invirt-reload over the course of a single dpkg run.

The code is largely lifted from Ubuntu's update-initramfs.

  • Property svn:executable set to *
File size: 449 bytes
RevLine 
[702]1#!/bin/bash
2
[2941]3if [ "$DPKG_MAINTSCRIPT_PACKAGE" != '' ] && \
4    [ $# = 0 ] && \
5    dpkg-trigger --check-supported 2>/dev/null; then
6    if dpkg-trigger --no-await invirt-base; then
7        echo "invirt-reload: deferring update (trigger activated)"
8        exit 0
9    fi
10fi
11
[702]12for script in $(run-parts --test /etc/init.d); do
[1499]13    if [ "${script#/etc/init.d/invirt-}" != "$script" ]; then
[1609]14        invoke-rc.d "${script#/etc/init.d/}" force-reload
[702]15    fi
16done
Note: See TracBrowser for help on using the repository browser.