25 lines
715 B
Bash
25 lines
715 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
DIE() {
|
||
|
echo "$progname: error: $1" >&2
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
Main() {
|
||
|
if [ -f "/etc/dnscrypt-proxy/dnscrypt-proxy.toml" ] && [ -f "/etc/dnscrypt-proxy/resolv.conf" ] && [ -f "/etc/resolv.conf" ]; then
|
||
|
chattr -V -i /etc/resolv.conf
|
||
|
cp -vf /etc/resolv.conf /etc/resolv.conf.bak
|
||
|
cp -vf /etc/dnscrypt-proxy/resolv.conf /etc/resolv.conf
|
||
|
chattr -V +i /etc/resolv.conf
|
||
|
fi
|
||
|
|
||
|
if [ -f "/etc/systemd/system/dbus-org.freedesktop.resolve1.service" ] || [ -f "/etc/systemd/system/sysinit.target.wants/systemd-resolved.service" ]; then
|
||
|
systemctl disable systemd-resolved.service
|
||
|
systemctl stop systemd-resolved.service
|
||
|
fi
|
||
|
|
||
|
return 0 # true
|
||
|
}
|
||
|
|
||
|
Main "$@"
|