aboutsummaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
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.