fix failed to backup config file
This commit is contained in:
parent
74c3a0b264
commit
f2ce3f2fc6
|
@ -63,19 +63,21 @@ ui_print " Vol- = Use previous config"
|
||||||
ui_print " "
|
ui_print " "
|
||||||
|
|
||||||
CONFIG_FILE=$MODPATH/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
|
CONFIG_FILE=$MODPATH/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
|
||||||
|
OLD_CONFIG_FILE=$(echo $CONFIG_FILE|sed s/modules_update/modules/)
|
||||||
|
|
||||||
|
|
||||||
if $FUNCTION; then
|
if $FUNCTION; then
|
||||||
ui_print "Replace old config"
|
ui_print "Replace old config"
|
||||||
ui_print " "
|
ui_print " "
|
||||||
cp -af $MODPATH/system/etc/example-dnscrypt-proxy.toml $CONFIG_FILE
|
cp -af $MODPATH/system/etc/dnscrypt-proxy/example-dnscrypt-proxy.toml $CONFIG_FILE
|
||||||
sed -i -e 's/127.0.0.1:53/127.0.0.1:5354/g' $CONFIG_FILE
|
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
|
sed -i -e 's/\[::1\]:53/\[::1\]:5354/g' $CONFIG_FILE
|
||||||
else
|
else
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
if [ -f "$OLD_CONFIG_FILE" ]; then
|
||||||
ui_print "* Backing up config file"
|
ui_print "* Backing up config file"
|
||||||
cp $CONFIG_FILE $TMPDIR
|
cp $CONFIG_FILE $TMPDIR
|
||||||
ui_print "* Restoring config files"
|
ui_print "* Restoring config files"
|
||||||
cp -af $TMPDIR/dnscrypt-proxy.toml $CONFIG_FILE
|
cp -af OLD_CONFIG_FILE $CONFIG_FILE
|
||||||
else
|
else
|
||||||
abort "First install have to choose replace mode"
|
abort "First install have to choose replace mode"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue