From 27ce69fd556991f8860444c78efd1d329d57f852 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 6 Nov 2013 15:30:09 -0800 Subject: [PATCH] CLOUDSTACK-5066: Don't remove the current VPN users when updating If one VPN user and password is existed in current setup, then don't touch it, otherwise would result in this user's existing connection be dropped. --- systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh index 86148a34624..5afe0096d9a 100755 --- a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh +++ b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh @@ -150,8 +150,12 @@ add_l2tp_ipsec_user() { local u=$1 local passwd=$2 - remove_l2tp_ipsec_user $u - echo "$u * $passwd *" >> /etc/ppp/chap-secrets + uptodate=$(grep "^$u \* $passwd \*$" /etc/ppp/chap-secrets) + if [ "$uptodate" == "" ] + then + remove_l2tp_ipsec_user $u + echo "$u * $passwd *" >> /etc/ppp/chap-secrets + fi } rflag=