HEX
Server: Apache
System: Linux vps37023 6.8.0-83-generic #83~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Sep 9 18:19:47 UTC 2 x86_64
User: alternativsm (5771646)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: //var/lib/dpkg/info/ulogd2.postinst
#!/bin/sh
set -e

# create ulog group if there isn't one already
if ! getent group ulog >/dev/null; then
	addgroup --system ulog >/dev/null
fi

# create ulog user if there isn't one already
if ! getent passwd ulog >/dev/null; then
	adduser --system --ingroup ulog --shell /bin/false \
		--home /var/log/ulog ulog >/dev/null
fi

# ensure the ulogd 1.x init script doesn't run
if [ -x "/etc/init.d/ulogd" ]; then
	update-rc.d -f ulogd remove >/dev/null
fi

case "$1" in
configure)
	# Set ownership and permissions on /var/log/ulog for new installs or
	# upgrades from << 2.0.5-5
	if dpkg --compare-versions "$2" lt '2.0.5-5~'; then
		mkdir -p /var/log/ulog
		chown ulog:adm /var/log/ulog
		chmod u=rwx,g=rx,o= /var/log/ulog
	fi
	;;
esac

# Automatically added by dh_installsystemd/12.2.3ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# In case this system is running systemd, we need to ensure that all
	# necessary tmpfiles (if any) are created before starting.
	if [ -d /run/systemd/system ] ; then
		systemd-tmpfiles --create ulogd2.conf >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installdeb/12.2.3ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/ulogd2.conf 2.0.7-1\~ -- "$@"
# End automatically added section
# Automatically added by dh_installinit/12.2.3ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/ulogd2" ]; then
		update-rc.d ulogd2 defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d ulogd2 $_dh_action || exit 1
	fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/12.2.3ubuntu1
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 'ulogd2.service' >/dev/null || true

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