From aa76dbead06eae23cdf09a021279c14cac20e4a6 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Mon, 29 Oct 2012 04:07:35 +0000 Subject: [PATCH] ip04 working version git-svn-id: https://svn.code.sf.net/p/freetel/code@889 01035d8c-6547-0410-b346-abe4f91aad63 --- mini-asterisk-gui2/cgi-bin/setlinekey2.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi b/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi index 673f8760..8687ee27 100755 --- a/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi +++ b/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi @@ -1,5 +1,5 @@ #!/bin/sh -x -# setlinekey.cgi +# setlinekey2.cgi # David Rowe 29 Oct 2012 # # CGI to set the text in "file" from "this" to "that" @@ -31,7 +31,8 @@ echo $that echo $key if [ -f $file ]; then # sed -i "s/\($this\)[a-z0-9\.]*\(.*$key.*\)/\1$that\2/" $file - cat $file | sed "s/\($this\)[a-z0-9\.]*\(.*$key.*\)/\1$that\2/" +rhs=`cat $file | grep -oe "host=[a-z0-9\.]*" | sed -n "s/host=//p"` +cat $file | sed "s/$rhs/$that/" else echo "$file does not exist" fi -- 2.25.1