diff --git a/common/install.sh b/common/install.sh index 0c3b63255..9c6a66dbd 100755 --- a/common/install.sh +++ b/common/install.sh @@ -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