From beb8c37d5c5abd06bc7c526529f88e39136f2753 Mon Sep 17 00:00:00 2001 From: Affif Mukhlashin Date: Wed, 1 May 2019 13:39:21 +0700 Subject: [PATCH] fix #40 --- common/option.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/option.sh b/common/option.sh index a0afa96..ed163c8 100755 --- a/common/option.sh +++ b/common/option.sh @@ -63,8 +63,6 @@ ui_print " Vol- = Use previous config" ui_print " " CONFIG_FILE=$MODPATH/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml -OLD_CONFIG_FILE=$(echo $CONFIG_FILE|sed s/modules_update/modules/) - if $FUNCTION; then ui_print "Replace old config" @@ -73,11 +71,11 @@ if $FUNCTION; then sed -i -e 's/127.0.0.1:53/127.0.0.1:5354/g' $CONFIG_FILE sed -i -e 's/\[::1\]:53/\[::1\]:5354/g' $CONFIG_FILE else - if [ -f "$OLD_CONFIG_FILE" ]; then + if [ -f "$CONFIG_FILE" ]; then ui_print "* Backing up config file" - cp $CONFIG_FILE $TMPDIR + cp -af $CONFIG_FILE $TMPDIR ui_print "* Restoring config files" - cp -af OLD_CONFIG_FILE $CONFIG_FILE + cp -af $TMPDIR/dnscrypt-proxy.toml $CONFIG_FILE else abort "First install have to choose replace mode" fi