melawy-archiso-config/Melawy-Linux-NetInstall/airootfs/usr/local/bin/dnscrypt-proxy-resolv.conf.sh

25 lines
715 B
Bash
Raw Normal View History

2025-01-13 03:01:42 +05:00
#!/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 "$@"