dnscrypt-proxy-android/customize.sh

58 lines
1.6 KiB
Bash
Raw Normal View History

ui_print " "
ui_print "******************************"
ui_print "* dnscrypt-proxy-android *"
2020-05-14 14:21:50 +00:00
ui_print "* 2.0.42-2 *"
ui_print "******************************"
ui_print "* quindecim *"
ui_print "******************************"
ui_print " "
if [ "$ARCH" == "arm" ];then
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-arm
elif [ "$ARCH" == "arm64" ];then
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-arm64
elif [ "$ARCH" == "x86" ];then
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-i386
elif [ "$ARCH" == "x64" ];then
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-x86_64
fi
2020-01-05 01:28:44 +00:00
CONFIG_PATH=$TMPDIR/config
unzip -o "$ZIPFILE" 'config/*' 'binary/*' -d $TMPDIR
ui_print "* Creating binary path"
mkdir -p $MODPATH/system/bin
ui_print "* Creating config path"
mkdir -p /data/media/0/dnscrypt-proxy
if [ -f "$BINARY_PATH" ]; then
2020-01-05 01:28:44 +00:00
ui_print "* Copying binary for $ARCH"
cp -af $BINARY_PATH $MODPATH/system/bin/dnscrypt-proxy
else
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
2020-01-05 01:28:44 +00:00
ui_print "* Backing up config file"
cp -af $CONFIG_FILE ${CONFIG_FILE}-`date +%Y%m%d%H%M`.bak
fi
if [ -d "$CONFIG_PATH" ]; then
2020-01-05 01:28:44 +00:00
ui_print "* Copying config, example and license files"
cp -af $CONFIG_PATH/* /data/media/0/dnscrypt-proxy/
else
abort "Config file is missing!"
fi
set_perm_recursive $MODPATH 0 0 0755 0755
set_perm $MODPATH/system/bin/dnscrypt-proxy 0 0 0755