Backup an existing config file before proceed

This commit is contained in:
quindecim 2019-12-07 05:30:13 -05:00
parent 3fbfa307c4
commit 277bee39d2
1 changed files with 11 additions and 2 deletions

View File

@ -165,8 +165,17 @@ on_install() {
abort "Binary file for $ARCH is missing!"
fi
# Backup an existing config file before proceed | quindecim
CONFIG_FILE="/data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml"
if [ -f "$CONFIG_FILE" ]; then
ui_print "* Backing up config file"
cp -afv $CONFIG_FILE ${CONFIG_FILE}-`date +%Y%m%d%H%M`.bak
fi
if [ -d "$CONFIG_PATH" ]; then
ui_print "* Copying example and license files"
ui_print "* Copying config, example and license files"
cp -af $CONFIG_PATH/* /data/media/0/dnscrypt-proxy/
else
abort "Config file is missing!"
@ -192,4 +201,4 @@ set_permissions() {
# set_perm $MODPATH/system/lib/libart.so 0 0 0644
}
# You can add more functions to assist your custom script code
# You can add more functions to assist your custom script code