3
# Remove a no-longer used conffile
8
[ -e "$CONFFILE" ] || return 0
10
local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
11
local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
12
sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
13
if [ "$md5sum" != "$old_md5sum" ]; then
14
echo "Obsolete conffile $CONFFILE has been modified by you."
15
echo "Saving as $CONFFILE.dpkg-bak ..."
16
mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
18
echo "Removing obsolete conffile $CONFFILE ..."
26
# removing obsolete conffiles from the 'ec2-init' package
27
if dpkg --compare-versions "$2" le "0.5.1"; then
28
rm_conffile ec2-init "/etc/init/cloud-ssh-keygen.conf"
30
if dpkg --compare-versions "$2" lt "0.5.3"; then
31
rm_conffile ec2-init "/etc/init/ec2init.conf"