preinst is in nis 3.17-32ubuntu6.
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 | #! /bin/sh
set -e
umask 022
# See how we were called in detail
case "$1" in
upgrade|install)
# If we're upgrading, save the old settings from
# /etc/init.d/nis so the postinst can substitute
# them into the new /etc/default/nis config file.
if [ ! -f /etc/default/nis ] && [ -f /etc/init.d/nis ]
then
grep "^NISSERVER=" /etc/init.d/nis \
> /etc/default/nis.settings || true
fi
;;
abort-upgrade)
;;
*)
;;
esac
# Manually remove the nis init script, which has to be split into per-daemon
# upstart jobs
if dpkg --compare-versions "$2" lt-nl 3.17-32ubuntu2
then
# since this isn't stopped on upgrade, we have to stop it now
# so we don't leave orphaned processes running
if [ -e "/etc/init.d/nis" ] && [ ! -L "/etc/init.d/nis" ]; then
invoke-rc.d nis stop
if [ "`md5sum \"/etc/init.d/nis\" | sed -e \"s/ .*//\"`" != \
"`dpkg-query -W -f='${Conffiles}' nis | sed -n -e \"\\\\' /etc/init.d/nis '{s/ obsolete$//;s/.* //p}\"`" ]
then
echo "Obsolete conffile /etc/init.d/nis has been modified by you, renaming to .dpkg-bak"
mv -f "/etc/init.d/nis" "/etc/init.d/nis.dpkg-bak"
else
rm -f "/etc/init.d/nis"
fi
update-rc.d nis remove
fi
fi
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/ypbind" ] && [ -L "/etc/init.d/ypbind" ] \
&& [ $(readlink -f "/etc/init.d/ypbind") = /lib/init/upstart-job ]
then
rm -f "/etc/init.d/ypbind"
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/start-ypbind" ] && [ -L "/etc/init.d/start-ypbind" ] \
&& [ $(readlink -f "/etc/init.d/start-ypbind") = /lib/init/upstart-job ]
then
rm -f "/etc/init.d/start-ypbind"
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/ypserv" ] && [ -L "/etc/init.d/ypserv" ] \
&& [ $(readlink -f "/etc/init.d/ypserv") = /lib/init/upstart-job ]
then
rm -f "/etc/init.d/ypserv"
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/yppasswdd" ] && [ -L "/etc/init.d/yppasswdd" ] \
&& [ $(readlink -f "/etc/init.d/yppasswdd") = /lib/init/upstart-job ]
then
rm -f "/etc/init.d/yppasswdd"
fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = install ] || [ "$1" = upgrade ]; then
if [ -e "/etc/init.d/ypxfrd" ] && [ -L "/etc/init.d/ypxfrd" ] \
&& [ $(readlink -f "/etc/init.d/ypxfrd") = /lib/init/upstart-job ]
then
rm -f "/etc/init.d/ypxfrd"
fi
fi
# End automatically added section
exit 0
|