bug fixing

This commit is contained in:
bluemeda 2018-03-07 02:14:20 +07:00
parent a7afa7cb05
commit 19eff34a4f
1 changed files with 12 additions and 8 deletions

View File

@ -105,10 +105,11 @@ install_dnscrypt_proxy(){
BINARY_PATH=$INSTALLER/binary/dnscrypt-proxy-arm64
fi
CONFIG_FILE=$MODPATH/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
CONFIG_FILE=$MODDIR/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
CONFIG_PATH=$INSTALLER/config
if [ ! -f "$CONFIG_FILE"]; then
if [ -f "$CONFIG_FILE" ]; then
ui_print "* Backing up config file"
cp $CONFIG_FILE $TMPDIR
fi
@ -121,24 +122,27 @@ install_dnscrypt_proxy(){
mkdir -p $MODPATH/system/etc/dnscrypt-proxy 2>/dev/null
if [ -f "$BINARY_PATH" ]; then
ui_print "Copying binary for $ARCH"
ui_print "* Copying binary for $ARCH"
cp -af $BINARY_PATH $MODPATH/system/xbin/dnscrypt-proxy
else
abort "Binary file for $ARCH is missing!"
fi
if [ -d "$CONFIG_PATH" ]; then
ui_print "Copying example and license files"
ui_print "* Copying example and license files"
cp -af $CONFIG_PATH/* $MODPATH/system/etc/dnscrypt-proxy
else
abort "Config file is missing!"
fi
if [ ! -f $CONFIG_FILE]; then
ui_print "copying config files"
cp -af $CONFIG_PATH/example-dnscrypt-proxy.toml $MODPATH/system/etc/dnscrypt-proxy/dnscrypt-proxy.toml
if [ ! -f "$CONFIG_FILE" ]; then
ui_print "* Copying config files"
cp -af $CONFIG_PATH/example-dnscrypt-proxy.toml $CONFIG_FILE
sed -i -e 's/127.0.0.1:53/127.0.0.1:5353/g' $CONFIG_FILE
sed -i -e 's/\[::1\]:53/\[::1\]:5353/g' $CONFIG_FILE
else
cp -af $TMPDIR/dnscrypt-proxy.toml $MODPATH/system/etc/dnscrypt-proxy.toml
ui_print "* Restoring config files"
cp -af $TMPDIR/dnscrypt-proxy.toml $CONFIG_FILE
fi
}