#!/bin/sh set -e # This maintainer script can be called the following ways: # # * new-postinst "configure" [$most_recently_configured_version] # The package is unpacked; all dependencies are unpacked and, when there # are no circular dependencies, configured. # # * old-postinst "abort-upgrade" $new_version # * old-postinst "abort-remove" # * conflictors-postinst "abort-remove" "in-favour" $new_package # $new_version # * deconfigureds-postinst "abort-deconfigure" "in-favour" # $failed_install_package $fip_version # new-package # ["removing" $conflicting_package $cp_version] # old-package # The package is unpacked; all dependencies are at least Half-Installed, # previously been configured, and not removed. In some error situations, # dependencies may not be even fully unpacked. # # * postinst "triggered" "${triggers[*]}" # For trigger-only calls, i.e. if "configure" is not called. # # * new-postinst "reconfigure" [$most_recently_configured_version](?) # Treat this as just like "configure" for a future extension by debconf. case $1 in (configure|reconfigure) test -c /dev/hwrng || test -c /dev/misc/hwrng || \ if test -x /sbin/MAKEDEV; then echo >&2 'I: Trying to create /dev/hwrng device node' (cd /dev && /sbin/MAKEDEV hwrng || :) fi :>/run/rngd.installing ;; (abort-upgrade|abort-remove|abort-deconfigure) ;; (triggered) ;; (*) echo >&2 "E: postinst called with unknown subcommand '$1'" exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installinit/13.23 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/rng-tools-debian" ]; then update-rc.d rng-tools-debian defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native rng-tools-debian $_dh_action || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.23 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'rng-tools-debian.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'rng-tools-debian.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'rng-tools-debian.service' >/dev/null || true else # 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 'rng-tools-debian.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.23 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'rng-tools-debian.service' >/dev/null || true fi fi # End automatically added section rm -f /run/rngd.installing exit 0