summaryrefslogtreecommitdiff
path: root/src/rvs-core/lib/rvsdb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/rvs-core/lib/rvsdb.sh')
-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
}