pkg://apmd_3.2.2-3_ia64.deb:65018/preinst
info downloads
#!/bin/sh
#
# This is the preinst script for the Debian GNU/Linux apmd package
#
# Written by Dirk Eddelbuettel <edd@debian.org>
set -e
update_config_files ()
(
if [ -f /etc/apm/event.d/00hwclock ]; then
if [ ! -e /etc/apm/scripts.d/hwclock ]; then
mkdir -p /etc/apm/scripts.d
cp -a /etc/apm/event.d/00hwclock /etc/apm/scripts.d/hwclock
fi
mv -f /etc/apm/event.d/00hwclock /etc/apm/event.d/00hwclock.dpkg-old
fi
PREFIX="/etc/logcheck/ignore.d."
FP="${PREFIX}paranoid/apmd"
FS="${PREFIX}server/apmd"
FW="${PREFIX}workstation/apmd"
if [ -f "${FP}" ]; then
if [ -f "${FS}" ] && cmp --quiet "${FP}" "${FS}"; then
rm -f "${FS}"
fi
if [ -f "${FW}" ] && cmp --quiet "${FP}" "${FW}"; then
rm -f "${FW}"
fi
fi
)
case "$1" in
(install)
update_config_files
;;
(upgrade)
# Stop a running apmd from an older version
if [ -f /usr/sbin/apmd ]; then
start-stop-daemon --stop --quiet --oknodo \
--pidfile /var/run/apmd.pid --exec /usr/sbin/apmd
fi
# Handle bug #4489: Old versions of apmd erroneously killed kerneld
# We test for these versions numbers, given by dpkg as $2, using an
# expr(1) match, and if the 5 chars are matched, restart the kerneld
if [ $(expr match "$2" '2\.[124]-[01]$') -eq 5 ]; then
/etc/init.d/kerneld start >/dev/null
fi
update_config_files
;;
(abort-upgrade)
;;
(*)
echo "preinst called with unknown argument \"$1\"" >&2
exit 1
;;
esac
exit 0