HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/thread-self/root/var/lib/dpkg/info/watchdog.postinst
#!/bin/sh
set -e


if [ "$1" = configure ]
then
    . /usr/share/debconf/confmodule

    if [ -x "`which MAKEDEV`" ]; then
	    # do we have to create the device?
	    if [ ! -c /dev/watchdog ]
	    then
		(cd /dev; MAKEDEV misc || true)
	    fi

	    # do we have to create the temperature device?
	    if [ ! -c /dev/temperature ]
	    then
		(cd /dev; MAKEDEV misc || true)
	    fi
    fi

    # one version set some incorrect permissions
    if [ -k /var/log/watchdog ]
    then
	chmod 750 /var/log/watchdog
    fi

    default_format="\
# Start watchdog at boot time? 0 or 1
run_watchdog=%s
# Start wd_keepalive after stopping watchdog? 0 or 1
run_wd_keepalive=%s
# Load module before starting watchdog
watchdog_module=%s
# Specify additional watchdog options here (see manpage).
"

    # Determine whether to start watchdog at boot time.
    db_get watchdog/run
    case $RET in
    false)  run_watchdog=0;;
    *)      run_watchdog=1;;
    esac

    db_get watchdog/module
    module=$RET

    # Determine whether to start wd_keepalive after stopping watchdog.
    db_get watchdog/run_keepalive
    case $RET in
    false)  run_wd_keepalive=0;;
    *)      run_wd_keepalive=1;;
    esac

    # Create an up-to-date copy of the default file.
    {
	# If it already exists, preserve everything except our comment
	# and $run_watchdog.
	if [ -f /etc/default/watchdog ]
	then
	    printf "$default_format" '.*' '.*' '.*' \
		| grep -vxf - /etc/default/watchdog \
		| grep -v watchdog_options || true
	fi

	# Append our comment and the current value.
	printf "$default_format" "$run_watchdog" "$run_wd_keepalive" "\"$module\""

	# And finally preserve the watchdog_options setting.
	if [ -f /etc/default/watchdog ]
	then
		grep watchdog_options /etc/default/watchdog || true
	fi
    } > /etc/default/watchdog.dpkg-new


    # Replace the original atomically.
    mv /etc/default/watchdog.dpkg-new /etc/default/watchdog

    # Restart if so configured.
    db_get watchdog/restart
    if [ "$RET" = true ]
    then
    	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d watchdog restart
	else
		/etc/init.d/watchdog stop > /dev/null 2>&1
		/etc/init.d/watchdog start
	fi
    fi

    #
    # stop debconf
    #
    db_stop
fi

# Not automatically added by dh_installinit (--noscripts)
update-rc.d watchdog defaults 89 11 >/dev/null
update-rc.d wd_keepalive start 09 2 3 4 5 . >/dev/null

# Automatically added by dh_installsystemd/13
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# This will only remove masks created by d-s-h on package removal.
	deb-systemd-helper unmask 'watchdog.service' >/dev/null || true

	# was-enabled defaults to true, so new installations run enable.
	if deb-systemd-helper --quiet was-enabled 'watchdog.service'; then
		# Enables the unit on first installation, creates new
		# symlinks on upgrades if the unit file has changed.
		deb-systemd-helper enable 'watchdog.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 'watchdog.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13
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 'watchdog.service' >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13
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 'wd_keepalive.service' >/dev/null || true
	fi
fi
# End automatically added section