postinst is in ifupdown-scripts-zg2 0.6-1.
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 | #!/bin/bash
set -e
[ -n "$IUDSZG2DEBUG" ] && set -x
STATEPDIR="/etc/network/run"
STATEDIR="$STATEPDIR/ifupdown-scripts-zg2"
OLDSTATEDIR="/var/lib/ifupdown-scripts-zg2"
if [ "$1" = "configure" ]; then
update-ifupdown-scripts-zg2.d-symlinks
if [ -d "$OLDSTATEDIR" ]; then
# OLDSTATEDIR stll exists, migrate state files from there
if ! [ -d "$STATEPDIR" ]; then
echo >&2 "ERR: missing $STATEPDIR. Is ifupdown configured?"
exit 1
fi
[ -d "$STATEDIR" ] || mkdir -m 755 "$STATEDIR"
for file in $(ls ${OLDSTATEDIR}/*.state 2>/dev/null); do
if ! [ -e "$STATEDIR/$(basename $file)" ]; then
mv "$file" "$STATEDIR/$(basename $file)"
else
echo >&2 "ERR: $(basename $file) exists in both $STATEDIR and $OLDSTATEDIR. This should not happen."
exit 1
fi
done
# OLDSTATEDIR should be empty now
if [ "$(ls -A $OLDSTATEDIR | wc -l)" != 0 ]; then
echo >&2 "ERR: $OLDSTATEDIR not empty."
exit 1
fi
rmdir "$OLDSTATEDIR"
fi
fi
# Automatically added by dh_installinit
if [ -x "/etc/init.d/ifupdown-scripts-zg2" ]; then
if [ ! -e "/etc/init/ifupdown-scripts-zg2.conf" ]; then
update-rc.d ifupdown-scripts-zg2 start 18 S . >/dev/null
fi
fi
# End automatically added section
|