1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
CumulusNetworks-ifupdown2/debian/python-ifupdown2.preinst
Roopa Prabhu ff50f301d5 move ifupdown2/* .
ifupdown2 code was one level deeper because ifupdown2 initially
had ifupdown2 and ifupdown2-addons as two separate packages.
Since they were combined into one package, it makes sense to
move all combined code under the top level directory

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-08-02 05:05:52 -07:00

57 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# preinst script for newpkg
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
preinst_upgrade()
{
local oldver="$1"
local udev_user_rulesdir="/etc/udev/rules.d"
# we have to fixup the filesystem here as previous packages of
# ifupdown2 introduced a bug in the postrm script that require
# these files to exist, otherwise the postrm script will always
# fail.
local badver="0.1-cl2.5+2"
if dpkg --compare-versions "${oldver}" "lt" "${badver}"; then
local files="${udev_user_rulesdir}/80-networking.rules
${udev_user_rulesdir}/60-bridge-network-interface.rules"
for f in ${files}; do
echo "touching udev rule: ${f}"
test ! -e "${f}" && ln -s /dev/null "${f}" || \
/bin/echo -e "\tudev rule exists leaving"
done
fi
}
case "$1" in
install|upgrade)
preinst_upgrade "$2"
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0