Skip to content

Commit

Permalink
bugfix: sed handle / replacement failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yinxiyi committed Sep 25, 2014
1 parent fc89d07 commit a89b57f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions init
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#set -x

config="/system/conf/dnsmasq.conf";
curdir=$(cd $(dirname $0) && pwd)
Expand All @@ -12,13 +13,15 @@ usage() {

delConfDir() {
/system/sbin/writesys.sh
/bin/sed -ie "/conf-dir=$hdnsconf/d" $config 1>/dev/null 2>&1
local hdnsdir=`echo "$curdir/conf" | sed -e 's:/:\\\\/:g'`
/bin/sed -ie "/conf-dir=$hdnsdir/d" $config 1>/dev/null 2>&1
/system/sbin/writesys.sh close
}

addConfDir() {
/system/sbin/writesys.sh
/bin/sed -ie "/conf-dir=$hdnsconf/d" $config 1>/dev/null 2>&1
local hdnsdir=`echo "$curdir/conf" | sed -e 's:/:\\\\/:g'`
/bin/sed -ie "/conf-dir=$hdnsdir/d" $config 1>/dev/null 2>&1
echo $hdnsconf >> $config
/system/sbin/writesys.sh close
}
Expand Down Expand Up @@ -67,7 +70,7 @@ install(){
# main
if [ $# -lt 1 ]; then
usage
exit -1
exit 1
fi

case "$1" in
Expand Down

0 comments on commit a89b57f

Please sign in to comment.