diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2006-11-06 20:09:04 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2006-11-06 20:09:04 +0000 |
commit | 3f320d348f94c33a88b013e1b4011ecf5d2033ce (patch) | |
tree | b369d7e0ae01848c51623cca64df847ce714a9a4 /debian/strongswan.postinst | |
parent | 4f4d9f7a0e48ee9caa58a9e6ec62485a917a3924 (diff) | |
download | vyos-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.postinst | 36 |
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 |