mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
Updated Updates (markdown)
parent
4e99f263fe
commit
50df2f94b1
1 changed files with 21 additions and 19 deletions
40
Updates.md
40
Updates.md
|
@ -6,40 +6,42 @@ If the installed version is older, then the script will update to the newest ver
|
|||
Tested on: Ubuntu 18.04
|
||||
|
||||
## Requirements
|
||||
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/opt/dnscrypt-proxy` and for the configuration file to be named `dnscrypt-proxy.toml`.
|
||||
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/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.
|
||||
If dnscrypt-proxy is not run as root then, change `chown root:root -R /opt/dnscrypt-proxy` to the user dnscrypt-proxy is run as.
|
||||
|
||||
## Configuration
|
||||
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`
|
||||
`0 */12 * * * /path/to/script.sh`
|
||||
|
||||
Also, this script needs to be run as root.
|
||||
|
||||
```#!/bin/bash
|
||||
```bash
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
Update() {
|
||||
cd /opt/dnscrypt-proxy
|
||||
sudo mv dnscrypt-proxy.toml /opt/
|
||||
mv dnscrypt-proxy.toml /opt/
|
||||
cd /opt
|
||||
sudo curl -L -O $( curl -s https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases | 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
|
||||
curl -L -O $( curl -s https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases | grep dnscrypt-proxy-linux_x86_64- | grep browser_download_url | head -1 | cut -d \" -f 4 )
|
||||
service dnscrypt-proxy stop
|
||||
rm -rf /opt/dnscrypt-proxy
|
||||
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 1775 -R /opt/dnscrypt-proxy
|
||||
sudo cp -f /etc/resolv.conf /etc/resolv.conf.backup
|
||||
mkdir /opt/dnscrypt-proxy
|
||||
mv * /opt/dnscrypt-proxy
|
||||
mv -f /opt/dnscrypt-proxy.toml /opt/dnscrypt-proxy
|
||||
chown root:root -R /opt/dnscrypt-proxy
|
||||
chmod 1775 -R /opt/dnscrypt-proxy
|
||||
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
|
||||
rm -rf dnscrypt-proxy-linux_x86_*
|
||||
rm -rf linux-x86_64
|
||||
service dnscrypt-proxy start
|
||||
service dnscrypt-proxy status
|
||||
}
|
||||
|
||||
lversion() {
|
||||
|
|
Loading…
Add table
Reference in a new issue