-
Notifications
You must be signed in to change notification settings - Fork 1k
Updates
The script below will check to see if dnscrypt-proxy needs updating by comparing the installed version with the latest git version.
If the installed version is older, then the script will update to the newest version.
Tested on: Ubuntu 18.04
This script requires dnscrypt-proxy to be installed as a service using,./dnscrypt-proxy -service install
and for dnscrypt-proxy to be installed in /opt/dnscrypt-proxy
and for the configuration file to be named dnscrypt-proxy.toml
.
If dnscrypt-proxy is not run as root then, change sudo chown root:root -R /opt/dnscrypt-proxy
to the user dnscrypt-proxy is run as.
Initially make sure all the above requirements are met.
Then to get this script to automatically run add this as a cron job under root using sudo crontab -e
but, change the file path to the file path the script is saved.
0 */12 * * * /file path/dnscrypt-proxy-update.sh
Also, this script needs to be run as root.
#!/bin/bash
Update() {
cd /opt/dnscrypt-proxy
sudo mv dnscrypt-proxy.toml /opt/
cd /opt
sudo curl -L -O $( curl -s https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases/latest | grep dnscrypt-proxy-linux_x86_64- | grep browser_download_url | head -1 | cut -d \" -f 4 )
sudo service dnscrypt-proxy stop
sudo rm -rf /opt/dnscrypt-proxy
sudo tar xvzf dnscrypt-proxy-linux_x86_64-*.tar.gz
cd linux-x86_64
sudo mkdir /opt/dnscrypt-proxy
sudo mv * /opt/dnscrypt-proxy
sudo mv -f /opt/dnscrypt-proxy.toml /opt/dnscrypt-proxy
sudo chown root:root -R /opt/dnscrypt-proxy
sudo chmod 775 /opt/dnscrypt-proxy
sudo cp -f /etc/resolv.conf /etc/resolv.conf.backup
cd /opt
sudo rm -rf dnscrypt-proxy-linux_x86_*
sudo rm -rf linux-x86_64
sudo service dnscrypt-proxy start
sudo service dnscrypt-proxy status
}
lversion=$(
cd /opt/dnscrypt-proxy
./dnscrypt-proxy -version
)
rmersion=$(
curl -s https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases/latest | grep "tag_name" | head -1 | cut -d \" -f 4
)
echo locally installed
echo $lversion
echo remote git version
echo $rmersion
if [[ "$rmersion" > "$lversion" ]]
then
echo Updating && Update
else
echo No Update Needed
fi
In somecases if you want to run dnscrypt-proxy as a non-root user you'll get the error "[FATAL] listen udp 0.0.0.0:53: bind: permission denied"
to solve this problem you can run the following command and allow dnscrypt to have access to a low level port :
sudo setcap cap_net_bind_service=+ep $(which dnscrypt-proxy)
- Home
- Installation
- Configuration
- Checking that your DNS traffic is encrypted
- Automatic Updates
- Server sources
- Combining blocklists
- Public Blocklist and other configuration files
- Building from source
- Run your own DNSCrypt server in under 10 minutes
- DNS stamps specifications
- Windows Tips
- dnscrypt-proxy in the media
- Planned Features