summaryrefslogtreecommitdiff
path: root/src/rvs-core/lib
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-07-17 00:05:43 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:11 -0600
commit582f21486665f202646954f3c37aa9a3d60f61b0 (patch)
tree08a098f6e7feac57b141e2dc47fd64ac610832a3 /src/rvs-core/lib
parentf65a0644e57c6c09f6fe9a8cf496ec497d0d0a27 (diff)
doing a lot better, still not functional
Diffstat (limited to 'src/rvs-core/lib')
-rw-r--r--src/rvs-core/lib/rvsdb.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rvs-core/lib/rvsdb.sh b/src/rvs-core/lib/rvsdb.sh
index 3ced573..a02304b 100644
--- a/src/rvs-core/lib/rvsdb.sh
+++ b/src/rvs-core/lib/rvsdb.sh
@@ -62,12 +62,15 @@ logwrite() {
#lines=`_find "$log" '1' "$var"`
#if [ "$lines" = '' ]; then
- if [ `lograw "$log" | grep "^$var:"` = '' ]; then
+ if [ "`lograw "$log" | grep "^$var:"`" == '' ]; then
# no exiswhereting occurances
echo "$var:$val" >> "$log"
else
# found others
- sed -i "^s/$var:.*/$var:$val/" "$log"
+ # escape slashes
+ var=`echo "$var" | sed 's:/:\\\\/:g'`
+ val=`echo "$val" | sed 's:/:\\\\/:g'`
+ sed -i "s/^$var:.*$/$var:$val/" "$log"
#lograw "$log" | ??????
fi
}