I did not proceed with my problem until today.
I read a good site
now I have this and it works.
openvpn.conf looks like:
#remote 10.0.0.1 1941
remote mail.google.com 1900
#remote mail.google.com 1912
#remote mail.google.com 2301
It deletes old lines with the context google and insert a new one.
Also some duplicate lines are removed.
sed -e '/^remote/s/remote/#remote/g
/remote.*google/d' openvpn.conf |uniq > tmp.txt
sed -e '/remote/a\
remote mail.google.com 2201
' tmp.txt > tmp1.txt
mv tmp1.txt openvpn.conf
And I have a script to change ini file variables
for 0 to 1 like:
/PreSave.*=/s/1/0/g' Prog.ini > Prog.new
mv Prog.new Prog.ini
Maybe these scrips can be modified. However, have fun with it.