aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-ipsec
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-07-03 01:32:57 +0000
committerBill Nottingham <notting@redhat.com>2003-07-03 01:32:57 +0000
commit5a7f7acb80b4432be8988aefb15912b4c60a2e9f (patch)
tree792660d66c593a2aad867fb42e9cd2101321bf18 /sysconfig/network-scripts/ifdown-ipsec
parent5f300c1d2d2e73479d4486d0c5773cff107582d1 (diff)
downloadinitscripts-5a7f7acb80b4432be8988aefb15912b4c60a2e9f.tar
initscripts-5a7f7acb80b4432be8988aefb15912b4c60a2e9f.tar.gz
initscripts-5a7f7acb80b4432be8988aefb15912b4c60a2e9f.tar.bz2
initscripts-5a7f7acb80b4432be8988aefb15912b4c60a2e9f.tar.xz
initscripts-5a7f7acb80b4432be8988aefb15912b4c60a2e9f.zip
set $KEYING
do something with racoon on bringing the interface down
Diffstat (limited to 'sysconfig/network-scripts/ifdown-ipsec')
-rwxr-xr-xsysconfig/network-scripts/ifdown-ipsec33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown-ipsec b/sysconfig/network-scripts/ifdown-ipsec
index d5f8ec50..60480cdb 100755
--- a/sysconfig/network-scripts/ifdown-ipsec
+++ b/sysconfig/network-scripts/ifdown-ipsec
@@ -8,6 +8,32 @@ CONFIG=$1
[ -f "${CONFIG}" ] || CONFIG=ifcfg-${1}
source_config
+if [ -n "$IKE_PSK" ]; then
+ KEYING=automatic
+ IKE_METHOD=PSK
+fi
+
+if [ -n "$IKE_CERTFILE" ]; then
+ KEYING=automatic
+ IKE_METHOD=X509
+fi
+
+if [ -n "$IKE_PEER_CERTFILE" ]; then
+ KEYING=automatic
+ IKE_METHOD=X509
+fi
+
+if [ -n "$IKE_DNSSEC" ]; then
+ KEYING=automatic
+ IKE_METHOD=X509
+fi
+if [ -n "$RSA_KEY" ]; then
+ KEYING=automatic
+ IKE_METHOD=RSA
+fi
+
+[ -z "$KEYING" ] && KEYING=manual
+
if [ -z "$SRC" ]; then
SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"`
fi
@@ -26,4 +52,11 @@ spddelete $SRC $DST any -P out;
spddelete $DST $SRC any -P in;
EOF
+if [ "$KEYING" = "automatic" ]; then
+ racoontmp=`mktemp /etc/racoon/racoon.XXXXXX`
+ grep -v "^include \"/etc/racoon/$DST.conf\"" /etc/racoon/racoon.conf >> $racoontmp
+ mv -f $racoontmp /etc/racoon/racoon.conf
+ pidof -x /usr/sbin/racoon > /dev/null 2>&1 && killall -HUP /usr/sbin/racoon
+fi
+
/etc/sysconfig/network-scripts/ifdown-post $CONFIG