Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply resolvectl dns servers even without netplan #3441

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions common/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ fi
sudo systemctl unmask --now systemd-resolved.service
systemctl enable --now systemd-resolved >/dev/null 2>&1
python3 change_dns.py 8.8.8.8 1.1.1.1
resolvectl dns `ip -br a | grep -E "enp|ens|eno|eth" | awk '{print $1}'` 8.8.8.8 1.1.1.1
touch /var/spool/cron/crontabs/root

if [ $(grep -c "resolvectl" /var/spool/cron/crontabs/root) -eq 0 ]
then
echo "0 * * * * resolvectl dns `ip -br a | grep -E "enp|ens|eno|eth" | awk '{print $1}'` 8.8.8.8 1.1.1.1 >/dev/null 2>&1" >> /var/spool/cron/crontabs/root
echo "@reboot resolvectl dns `ip -br a | grep -E "enp|ens|eno|eth" | awk '{print $1}'` 8.8.8.8 1.1.1.1 >/dev/null 2>&1" >> /var/spool/cron/crontabs/root
fi

ln -sf $(pwd)/sysctl.conf /etc/sysctl.d/ss-opt.conf

Expand Down