This file is indexed.

postinst is in vdradmin-am 3.6.9-3.

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
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh -e
set -e

# Check if there are still cfgfiles in /var/lib/vdradmin/ and move them
# to /var/lib/vdradmin-am
if [ ! -f /var/lib/vdradmin-am/vdradmind.conf ]; then
  if [ -f /var/lib/vdradmin/vdradmind.conf ]; then
     mv /var/lib/vdradmin/vdradmind.conf /var/lib/vdradmin-am/
  else
     cp /usr/share/vdradmin-am/vdradmind.conf /var/lib/vdradmin-am/
  fi
fi

if [ ! -e /etc/vdradmin-am/vdradmind.conf ]; then
        ln -s /var/lib/vdradmin-am/vdradmind.conf /etc/vdradmin-am/vdradmind.conf
fi

if [ ! -f /var/lib/vdradmin-am/vdradmind.at ]; then
   if [ -f /var/lib/vdradmin/vdradmind.at ]; then 
      mv /var/lib/vdradmin/vdradmind.at /var/lib/vdradmin-am/
   fi
fi

if [ ! -f /var/lib/vdradmin-am/vdradmind.done ]; then
   if [ -f /var/lib/vdradmin/vdradmind.done ]; then 
      mv /var/lib/vdradmin/vdradmind.done /var/lib/vdradmin-am/
   fi
fi

if [ ! -f /var/lib/vdradmin-am/vdradmind.bl ]; then
   if [ -f /var/lib/vdradmin/vdradmind.bl ]; then 
      mv /var/lib/vdradmin/vdradmind.bl /var/lib/vdradmin-am/
   fi
fi

# ensure that user and group 'vdradmin-am' exist
USER=vdradmin-am
GROUP=vdradmin-am
if ! getent group | grep -q "^$GROUP:" ; then
    echo -n "Adding group $GROUP.."
    addgroup --quiet --system $GROUP
    echo "..done"
fi
if ! getent passwd | grep -q "^$USER:"; then
    echo -n "Adding user $USER.."
    adduser --system --home /var/lib/vdradmin-am --shell /bin/false \
      --gecos "VDRAdmin-am user" --no-create-home \
      --disabled-login --disabled-password \
      --ingroup $GROUP \
      $USER
    echo "...done"
fi

# ensure vdradmind.at (auto timers) exists
ATFILE=/var/lib/vdradmin-am/vdradmind.at
[ -e $ATFILE ] || touch $ATFILE

# ensure that vdradmin's config files have the correct owner
[ ! -d /var/lib/vdradmin-am ] || chown -R $USER:$GROUP /var/lib/vdradmin-am/

# change the permissions of the cfg-file to 0600
[ ! -e /var/lib/vdradmin-am/vdradmind.conf ] || chmod 0600 /var/lib/vdradmin-am/vdradmind.conf

# change the owner and group of the logfile to vdradmin
[ ! -e /var/log/vdradmind.log ] || chown $USER:$GROUP /var/log/vdradmind.log

# make auto timer file "read/writeable" by group vdr and config file readable
# by group "vdr",so that vdr plugins (Autotimeredit plugin) get access
if getent group | grep -q "^vdr:" ; then
    if [ -d /var/lib/vdradmin-am ] ; then
        chgrp -R vdr /var/lib/vdradmin-am
        chmod a=,ug=rwx /var/lib/vdradmin-am
        chmod a=,ug=rw $ATFILE
        CFGFILE=/var/lib/vdradmin-am/vdradmind.conf
        [ -e $CFGFILE ] && chmod a=,u=rw,g=r $CFGFILE
    fi
fi

# ensure that vdradmin's directories have the correct owner
for dir in /var/cache/vdradmin-am /var/log/vdradmin-am /var/lib/vdradmin-am; do
    [ ! -d $dir ] || chown -R $USER:$GROUP $dir
done

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