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=