0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.22.41.80


Current Path : /proc/thread-self/root/var/lib/dpkg/info/
Upload File :
Current File : //proc/thread-self/root/var/lib/dpkg/info/irqbalance.postinst

#!/bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0

CONF=/etc/default/irqbalance
CONFCONVERT=/etc/default/irqbalance.dpkg-needs-convert

if [ "$1" = "configure" ]; then
    if [ "$2" != "" ] && dpkg --compare-versions "$2" lt "1.0.5-1"; then
        update-rc.d -f irqbalance remove >/dev/null
    fi

    # The debian/irqbalance.config file already takes care of
    # integrating the old ENABLED and ONESHOT into the loop, but
    # we still need this here to preserve any other random
    # things the local sysadmin has added to the old /etc/default/irqbalance
    # file to be policy compliant.
    if [ -e $CONFCONVERT ]; then
        # Insert a header to help sysadmin figure out why these things are here.
        sed -i '1 i\# This file was modified on irqbalance 1.1.0-2.1 pkg upgrade. Preserved settings:' $CONFCONVERT

	# Drop the ENABLED and ONESHOT settings, already handled via debconf.
        sed -i -e '/ *ENABLED=.*/d' -e '/ *ONESHOT=.*/d' $CONFCONVERT

	# Check if we have anything remaining except comments, if so
        # we append the old file to the new one.
	# This is to preserve any random things that might have
        # been added to the file by the local sysadmin.
	if grep -qv '^$\|^\s*#' $CONFCONVERT; then
        	cat $CONFCONVERT >> $CONF
	fi
        rm -f $CONFCONVERT
    fi

    db_get irqbalance/enable
    update-rc.d irqbalance defaults >/dev/null
    if [ "$RET" = "true" ]; then
        update-rc.d irqbalance enable >/dev/null
    else
        update-rc.d irqbalance disable >/dev/null
    fi
    db_get irqbalance/oneshot
    if [ "$RET" = "true" ]; then
        # Modify existing line to enable or add a new one.
        if grep -q '^\s*#*\s*IRQBALANCE_ONESHOT\s*=' $CONF ; then
            sed -i 's/^\s*#*\s*IRQBALANCE_ONESHOT\s*=.*/IRQBALANCE_ONESHOT=yes/' $CONF
        else
            # Disable by commenting any existing line
            # (or ignore relying on default disabled).
            sed -i 's/^\s*IRQBALANCE_ONESHOT\s*=/#IRQBALANCE_ONESHOT=/' $CONF
        fi
    else
        sed -i 's/^\s*IRQBALANCE_ONESHOT=/#IRQBALANCE_ONESHOT=/' $CONF
    fi

    db_stop
fi

# Automatically added by dh_systemd_enable/10.10.9ubuntu1
if deb-systemd-helper debian-installed 'irqbalance.service'; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'irqbalance.service' >/dev/null || true

	if deb-systemd-helper --quiet was-enabled 'irqbalance.service'; then
		# Create new symlinks, if any.
		deb-systemd-helper enable 'irqbalance.service' >/dev/null || true
	fi
fi

# Update the statefile to add new symlinks (if any), which need to be cleaned
# up on purge. Also remove old symlinks.
deb-systemd-helper update-state 'irqbalance.service' >/dev/null || true
# End automatically added section
# Automatically added by dh_installinit/10.10.9ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/irqbalance" ]; then
		update-rc.d irqbalance defaults >/dev/null
		invoke-rc.d irqbalance start || exit $?
	fi
fi
# End automatically added section
# Automatically added by dh_installdeb/10.10.9ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/irqbalance.conf 1.2.0-0.1~ -- "$@"
# End automatically added section