File Manager

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

#!/bin/sh

set -e

USER="stunnel4"
CHOWN="/bin/chown"

# Automatically added by dh_installsysusers/13.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
   if [ -z "${DPKG_ROOT:-}" ] ; then
      systemd-sysusers stunnel4.conf
   fi
fi
# End automatically added section
# Automatically added by dh_installinit/13.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/stunnel4" ]; then
		update-rc.d stunnel4 defaults-disabled >/dev/null || exit 1
	fi
fi
# End automatically added section
# Automatically added by dh_installsystemd/13.6ubuntu1
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 'stunnel.target' >/dev/null || true

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


# /var/run/stunnel4 is not a directory, create it...
if ! test -d /var/run/stunnel4; then
	rm -rf /var/run/stunnel4;
	mkdir /var/run/stunnel4
fi
$CHOWN -- "$USER:$USER" /var/run/stunnel4 || true

# /var/log/stunnel4 is not a directory, create it...
if ! test -d /var/log/stunnel4; then
	rm -rf /var/log/stunnel4;
	mkdir /var/log/stunnel4
fi
$CHOWN -R -- "$USER:$USER" /var/log/stunnel4

# /var/lib/stunnel4 is not a directory, create it...
if ! test -d /var/lib/stunnel4; then
	rm -rf /var/lib/stunnel4;
	mkdir /var/lib/stunnel4
fi
$CHOWN -R -- "$USER:$USER" /var/lib/stunnel4

if ! test -f /var/log/stunnel4/stunnel.log; then
	touch /var/log/stunnel4/stunnel.log
	$CHOWN -R -- "$USER:$USER" /var/log/stunnel4/stunnel.log
fi

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com