This file is indexed.

postinst is in stunnel4 3:4.53-1.1ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh

set -e

USER="stunnel4"
CHOWN="/bin/chown"
#USERDEL="/usr/sbin/userdel"
ADDUSER="/usr/sbin/adduser"
ID="/usr/bin/id"
GROUPMOD="/usr/sbin/groupmod"
#GROUPDEL="/usr/sbin/groupdel"

###
# 1. get current stunnel uid and gid if user exists.
set -e
if $ID $USER > /dev/null 2>&1; then
   IUID=`$ID --user $USER`
   IGID=`$ID --group $USER`
else
   IUID="NONE"
   IGID="NONE"
fi

###
# 2. Ensure that no standard account or group will remain before adding the
#    new user
#if [ "$IUID" != "NONE" ]; then # remove existing user
#  $USERDEL $USER
#fi

#if $GROUPMOD $USER > /dev/null 2>&1; then 
#  $GROUPDEL $USER;
#fi

if [ "$IUID" = "NONE" ]; then
  $ADDUSER --system --disabled-password --disabled-login	\
           --home /var/run/stunnel4			\
	   --no-create-home --group $USER
fi

# /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

# Automatically added by dh_installinit
if [ -x "/etc/init.d/stunnel4" ] || [ -e "/etc/init/stunnel4.conf" ]; then
	if [ ! -e "/etc/init/stunnel4.conf" ]; then
		update-rc.d stunnel4 defaults >/dev/null
	fi
	if [ -n "$2" ]; then
		_dh_action=restart
	else
		_dh_action=start
	fi
	invoke-rc.d stunnel4 $_dh_action || exit $?
fi
# End automatically added section