summaryrefslogtreecommitdiff
path: root/debian/strongswan.postinst
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2006-11-06 20:09:04 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2006-11-06 20:09:04 +0000
commit3f320d348f94c33a88b013e1b4011ecf5d2033ce (patch)
treeb369d7e0ae01848c51623cca64df847ce714a9a4 /debian/strongswan.postinst
parent4f4d9f7a0e48ee9caa58a9e6ec62485a917a3924 (diff)
downloadvyos-strongswan-3f320d348f94c33a88b013e1b4011ecf5d2033ce.tar.gz
vyos-strongswan-3f320d348f94c33a88b013e1b4011ecf5d2033ce.zip
- Fix an important bug: renaming of the no_oe.conf to oe.conf. Changes
to postinst. - Update debconf translations.
Diffstat (limited to 'debian/strongswan.postinst')
-rw-r--r--debian/strongswan.postinst36
1 files changed, 26 insertions, 10 deletions
diff --git a/debian/strongswan.postinst b/debian/strongswan.postinst
index 5875db9db..13a11017d 100644
--- a/debian/strongswan.postinst
+++ b/debian/strongswan.postinst
@@ -206,23 +206,39 @@ case "$1" in
db_get strongswan/enable-oe
if [ "$RET" != "true" ]; then
echo -n "Disabling opportunistic encryption (OE) in config file ... "
- if egrep -q "^include /etc/ipsec.d/examples/no_oe.conf$" /etc/ipsec.conf; then
- echo "already disabled"
+ if egrep -q "include /etc/ipsec.d/examples/no_oe.conf$" /etc/ipsec.conf; then
+ # also update to new-style config
+ sed 's/.*include \/etc\/ipsec.d\/examples\/no_oe.conf/#include \/etc\/ipsec.d\/examples\/oe.conf/' < /etc/ipsec.conf > /etc/ipsec.conf.tmp
+ mv /etc/ipsec.conf.tmp /etc/ipsec.conf
+ echo -n "converted old config line to new format"
+ fi
+ if egrep -q "^include /etc/ipsec.d/examples/oe.conf$" /etc/ipsec.conf; then
+ sed 's/include \/etc\/ipsec.d\/examples\/oe.conf/#include \/etc\/ipsec.d\/examples\/oe.conf/' < /etc/ipsec.conf > /etc/ipsec.conf.tmp
+ mv /etc/ipsec.conf.tmp /etc/ipsec.conf
+ echo "done"
else
- cat <<EOF >> /etc/ipsec.conf
-#Disable Opportunistic Encryption
-include /etc/ipsec.d/examples/no_oe.conf
-EOF
- echo "done"
+ echo "already disabled"
fi
else
echo -n "Enabling opportunistic encryption (OE) in config file ... "
- if egrep -q "^include /etc/ipsec.d/examples/no_oe.conf$" /etc/ipsec.conf; then
- sed 's/include \/etc\/ipsec.d\/examples\/no_oe.conf/#include \/etc\/ipsec.d\/examples\/no_oe.conf/' < /etc/ipsec.conf > /etc/ipsec.conf.tmp
+ if egrep -q "include /etc/ipsec.d/examples/no_oe.conf$" /etc/ipsec.conf; then
+ # also update to new-style config
+ sed 's/.*include \/etc\/ipsec.d\/examples\/no_oe.conf/include \/etc\/ipsec.d\/examples\/oe.conf/' < /etc/ipsec.conf > /etc/ipsec.conf.tmp
+ mv /etc/ipsec.conf.tmp /etc/ipsec.conf
+ echo -n "converted old config line to new format"
+ fi
+ if egrep -q "^include /etc/ipsec.d/examples/oe.conf$" /etc/ipsec.conf; then
+ echo "already enabled"
+ elif egrep -q "^#.*include /etc/ipsec.d/examples/oe.conf$" /etc/ipsec.conf; then
+ sed 's/#.*include \/etc\/ipsec.d\/examples\/oe.conf/include \/etc\/ipsec.d\/examples\/oe.conf/' < /etc/ipsec.conf > /etc/ipsec.conf.tmp
mv /etc/ipsec.conf.tmp /etc/ipsec.conf
echo "done"
else
- echo "already enabled"
+ cat <<EOF >> /etc/ipsec.conf
+#Enable Opportunistic Encryption
+include /etc/ipsec.d/examples/oe.conf
+EOF
+ echo "done"
fi
fi