diff options
author | Miloslav Trmac <mitr@volny.cz> | 2006-07-08 01:51:36 +0000 |
---|---|---|
committer | Miloslav Trmac <mitr@volny.cz> | 2006-07-08 01:51:36 +0000 |
commit | 7be28bbb61b91fddf415e42dfe09bde94689b472 (patch) | |
tree | 3810d00ef66795ce7cd43217adae0ec8772ba0eb /sysconfig/network-scripts/ifup-ipsec | |
parent | 59246de763ead6ad4f7b8c7d8b2bb847e45f7865 (diff) | |
download | initscripts-7be28bbb61b91fddf415e42dfe09bde94689b472.tar initscripts-7be28bbb61b91fddf415e42dfe09bde94689b472.tar.gz initscripts-7be28bbb61b91fddf415e42dfe09bde94689b472.tar.bz2 initscripts-7be28bbb61b91fddf415e42dfe09bde94689b472.tar.xz initscripts-7be28bbb61b91fddf415e42dfe09bde94689b472.zip |
Move $SRC initialization before first use
Diffstat (limited to 'sysconfig/network-scripts/ifup-ipsec')
-rwxr-xr-x | sysconfig/network-scripts/ifup-ipsec | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifup-ipsec b/sysconfig/network-scripts/ifup-ipsec index 017414d9..ab055fe9 100755 --- a/sysconfig/network-scripts/ifup-ipsec +++ b/sysconfig/network-scripts/ifup-ipsec @@ -99,6 +99,10 @@ if [ -n "$IKE_DNSSEC" ]; then IKE_METHOD=X509 fi +if [ -z "$SRC" ]; then + SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` +fi + if [ -n "$SRCNET" -o -n "$DSTNET" ]; then MODE=tunnel [ -z "$SRCNET" ] && SRCNET="$SRC/32" @@ -116,11 +120,6 @@ fi [ -n "$IKE_METHOD" ] && KEYING=automatic [ -z "$KEYING" ] && KEYING=manual -# Get source address -if [ -z "$SRC" ]; then - SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` -fi - if [ "$KEYING" = "manual" ]; then |