postinst is in piuparts-master 0.84.
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 | #!/bin/sh
set -e
pgroup=piuparts
muser=piupartsm
scriptroot=/usr/share/piuparts
userhome=/var/lib/piuparts
if [ "$1" = "configure" ] ; then
addgroup --system --quiet $pgroup
for user in $muser
do
adduser --system --quiet --home $userhome/$user --ingroup $pgroup \
--shell /bin/sh $user
if ! [ -d $userhome/$user ]; then
mkdir -m 0755 $userhome/$user
chown $user:$pgroup $userhome/$user
fi
touch $userhome/$user/.profile
chown $user:$pgroup $userhome/$user/.profile
if [ $user = "piupartsm" ] ;
then
role="master"
else
role="slave"
fi
if ! grep -q $scriptroot/$role $userhome/$user/.profile ;
then
echo PATH=\$PATH:$scriptroot:$scriptroot/$role \
>>$userhome/$user/.profile
fi
if [ ! -d $userhome/$user/.ssh ] ; then
install -d -o $user -g $pgroup -m 0755 $userhome/$user/.ssh
fi
done
install -d -o $muser -g $pgroup -m 0755 $userhome/master
install -d -o $muser -g $pgroup -m 0755 $userhome/backup
install -d -o $muser -g $pgroup -m 0755 $userhome/htdocs
cp -rf $scriptroot/htdocs/* $userhome/htdocs/
for icon in weather-severe-alert.png sunny.png
do
if [ -h $userhome/htdocs/images/$icon ] ; then
rm -f $userhome/htdocs/images/$icon
fi
if [ -e /usr/share/icons/Tango/24x24/status/$icon ] ; then
cp -f /usr/share/icons/Tango/24x24/status/$icon $userhome/htdocs/images/$icon
fi
done
if dpkg --compare-versions "$2" lt-nl "0.50" ; then
rm -rf $userhome/master/monitor-slave
fi
fi
# Automatically added by dh_installdeb/11.1.4ubuntu1
dpkg-maintscript-helper mv_conffile /etc/apache2/conf.d/piuparts.apache /etc/apache2/conf-available/piuparts-master.conf 0.58\~ -- "$@"
# End automatically added section
|