From 7cd25e062ec060600f968bf3d14439cedb3e19f9 Mon Sep 17 00:00:00 2001 From: quindecim Date: Tue, 29 Oct 2019 13:59:07 -0400 Subject: [PATCH] Changed the way to backup an existing .toml file The old configuration is now backed up with a year-month-day-hour-minute suffix --- common/option.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) mode change 100755 => 100644 common/option.sh diff --git a/common/option.sh b/common/option.sh old mode 100755 new mode 100644 index f31eeb3..e6b9328 --- a/common/option.sh +++ b/common/option.sh @@ -1,13 +1,19 @@ -CONFIG_FILE=/data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml +CONFIG_FILE="/data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml" - if ! [ -f "$CONFIG_FILE" ]; then - # ui_print "* Backing up config file" + if [ -f "$CONFIG_FILE" ]; then + +## bluemeda + ui_print "* Backing up config file" # cp -afv $CONFIG_FILE $TMPDIR # ui_print "* Restoring config files" - # cp -af $TMPDIR/dnscrypt-proxy.toml $CONFIG_FILE - - cp -afv /data/media/0/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/\[::1\]:53/\[::1\]:5354/g' $CONFIG_FILE + # cp -af $TMPDIR/dnscrypt-proxy.toml $CONFIG_FILE + # cp -afv /data/media/0/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/\[::1\]:53/\[::1\]:5354/g' $CONFIG_FILE + +## quindecim + cp -afv $CONFIG_FILE ${CONFIG_FILE}-backup-`date +%Y%m%d%H%M` fi + + cp -afv /data/media/0/dnscrypt-proxy/my-dnscrypt-proxy.toml $CONFIG_FILE \ No newline at end of file