works on ip04 and some test cases
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 04:21:02 +0000 (04:21 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 04:21:02 +0000 (04:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@890 01035d8c-6547-0410-b346-abe4f91aad63

mini-asterisk-gui2/cgi-bin/setlinekey2.cgi

index 8687ee27dfac68a6f7d4dad7c04d1887c2fa9838..d05cfba57e42c84c83394511da0ae2428d390595 100755 (executable)
@@ -31,7 +31,7 @@ echo $that
 echo $key
 if [ -f $file ]; then
 #  sed -i  "s/\($this\)[a-z0-9\.]*\(.*$key.*\)/\1$that\2/"  $file
-rhs=`cat $file | grep -oe "host=[a-z0-9\.]*" | sed -n "s/host=//p"`
+rhs=`cat $file | grep -oe "$this.*$key" | grep -oe "$this[a-z0-9\.]*" | sed -n "s/host=//p"`
 cat $file | sed "s/$rhs/$that/"
 else
   echo "$file does not exist"