aboutsummaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-10-07 00:33:12 +0000
committerRob Austein <sra@hactrn.net>2014-10-07 00:33:12 +0000
commit6bda36580e5f441f6061db89fbc4bb3a270d7b68 (patch)
tree1bc309938bbae335c2d769129b044823d396bb8e /buildtools
parenta5c11895789ec72b04da84837b01e20bf790e59d (diff)
Ancient de-installation code broke on Trusty.
svn path=/trunk/; revision=5994
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/debian-skeleton/rpki-ca.prerm33
1 files changed, 18 insertions, 15 deletions
diff --git a/buildtools/debian-skeleton/rpki-ca.prerm b/buildtools/debian-skeleton/rpki-ca.prerm
index b6033cf2..c8387ac4 100644
--- a/buildtools/debian-skeleton/rpki-ca.prerm
+++ b/buildtools/debian-skeleton/rpki-ca.prerm
@@ -49,24 +49,27 @@ case "$1" in
# retain code needed to clean up nasty mess we created in the
# past, to avoid breaking old installations on upgrade.
- # Remove the old stuff first.
+ # Remove the old stuff first, if the containing file even exists.
f=/etc/apache2/sites-available/default-ssl
- awk < $f > ${f}.tmp '
- BEGIN {
- conf_file = "/etc/rpki/apache.conf";
- conf_regexp = "^[ \t]*Include[ \t]+" conf_file "[ \t]*$";
- }
- $0 !~ conf_regexp {
- print;
- }'
-
- if cmp -s ${f}.tmp ${f}.orig
+ if test -r $f
then
- mv -f ${f}.orig $f
- rm -f ${f}.tmp
- else
- mv -f ${f}.tmp $f
+ awk < $f > ${f}.tmp '
+ BEGIN {
+ conf_file = "/etc/rpki/apache.conf";
+ conf_regexp = "^[ \t]*Include[ \t]+" conf_file "[ \t]*$";
+ }
+ $0 !~ conf_regexp {
+ print;
+ }'
+
+ if cmp -s ${f}.tmp ${f}.orig
+ then
+ mv -f ${f}.orig $f
+ rm -f ${f}.tmp
+ else
+ mv -f ${f}.tmp $f
+ fi
fi
# At this point we've cleaned up our Apache config mess.