PREUN
/bin/sh
if [ $1 -eq 0 ]; then
chkconfig --del network > /dev/null 2>&1 || :
# Mageia specific (network-up):
chkconfig --del network-up > /dev/null 2>&1 || :
/usr/sbin/update-alternatives --remove ifup /etc/sysconfig/network-scripts/ifup
fi
# ---------------
POSTIN
/bin/sh
# (ovitters) remember $1 for usage in posttrans scriptlet as posttrans always
# sets $1 to 1. See see https://bugs.mageia.org/show_bug.cgi?id=19882 and the
# comment in posttrans scriplet
#
# Note: Logic is a bit weird to avoid a dependency on mkdir. The 'mkdir'
# command might not exist in the install case. On upgrade the system will have·
# 'mkdir'. So basically this post scriptlet tells posttrans not to run the
# 'install' logic.
#
# WARNING: Do NOT add a Requires(post) on coreutils! Might cause dependency
# loops (see above bug for detailed discussion
if [ "$1" -ne 1 ]; then
# ignore "mkdir" not found errors
mkdir -p "/var/lib/rpm-state/network-scripts.notinstall" 2> /dev/null || :
fi
POSTTRANS
/bin/sh
# (ovitters) The posttrans scriptlet always has $1 to 1. This confuses:
# 1. The systemd_post scriplet (makes use of $1).
# 2. Any usage of $1 in posttrans (was used to not call chkconfig)
#
# systemd_post scriptlet only does something when the rpm is installed.·
# Make use of that knowledge to only call these scriptlets when this package is
# first installed. See https://bugs.mageia.org/show_bug.cgi?id=19882
if [ ! -d "/var/lib/rpm-state/network-scripts.notinstall" ]; then
chkconfig --add network > /dev/null 2>&1 || :
# Mageia specific (network-up)
chkconfig --add network-up > /dev/null 2>&1 || :
# reset the state
rmdir "/var/lib/rpm-state/network-scripts.notinstall" 2> /dev/null || :
fi
[ -L /usr/sbin/ifup ] || rm -f /usr/sbin/ifup
[ -L /usr/sbin/ifdown ] || rm -f /usr/sbin/ifdown
/usr/sbin/update-alternatives --install /usr/sbin/ifup ifup /etc/sysconfig/network-scripts/ifup 90 \
--slave /usr/sbin/ifdown ifdown /etc/sysconfig/network-scripts/ifdown \
--initscript network