make an optional XAUTH user ID available in the updown script
[strongswan.git] / src / _updown_espmark / _updown_espmark
index b9ae6ed..163ef55 100644 (file)
 #              is  the  UDP/TCP  port  to  which  the IPsec SA  is
 #              restricted on the peer side.
 #
+#              PLUTO_XAUTH_USER
+#                              is an optional user ID employed by the XAUTH protocol
 
 # logging of VPN connections
 #
@@ -199,15 +201,12 @@ doroute() {
 
        if [ -z "$PLUTO_MY_SOURCEIP" ]
        then
-           if [ -f /etc/sysconfig/defaultsource ]
-           then
-               . /etc/sysconfig/defaultsource
-           fi
-
-           if [ -f /etc/conf.d/defaultsource ]
-           then
-               . /etc/conf.d/defaultsource
-           fi
+            for dir in /etc/sysconfig /etc/conf.d; do
+                if [ -f "$dir/defaultsource" ]
+                then
+                    . "$dir/defaultsource"
+                fi
+            done
 
            if [ -n "$DEFAULTSOURCE" ]
            then