postinst is in apt-mirror 0.5.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 | #!/bin/sh
set -e
setup_aptmirror_user() {
if ! id apt-mirror > /dev/null 2>&1; then
adduser --quiet --system --group --no-create-home --home /var/spool/apt-mirror --shell /bin/sh apt-mirror
fi
}
setup_aptmirror_clean() {
touch /var/spool/apt-mirror/var/clean.sh
touch /var/spool/apt-mirror/var/postmirror.sh
chmod +x /var/spool/apt-mirror/var/clean.sh
}
set_aptmirror_owner() {
chown apt-mirror:apt-mirror /var/spool/apt-mirror
chown apt-mirror:apt-mirror /var/spool/apt-mirror/mirror
chown apt-mirror:apt-mirror /var/spool/apt-mirror/skel
chown apt-mirror:apt-mirror /var/spool/apt-mirror/var
chown apt-mirror:apt-mirror /var/spool/apt-mirror/var/clean.sh
chown apt-mirror:apt-mirror /var/spool/apt-mirror/var/postmirror.sh
}
if test "$1" = "configure"; then
setup_aptmirror_user
setup_aptmirror_clean
set_aptmirror_owner
fi
|