2 Commits

Author SHA1 Message Date
fauno f4e8c6ff8b feat: usar proveedores alternativos de dns
cuando la red local no provee dns
2026-06-18 12:29:49 -03:00
fauno 7dbee24ff1 fix: avisar cuando el hostname contenga guiones 2026-06-18 10:25:48 -03:00
+16
View File
@@ -9,9 +9,16 @@ if ! test $UID -eq 0 ; then
exit 1
fi
hostname="`echo $HOSTNAME | tr -d "-" | tr -d "_"`"
dir="`realpath $0 | xargs dirname`"
authorized_keys=/home/$SUDO_USER/.ssh/authorized_keys
if test "$hostname" != "$HOSTNAME" ; then
not_ok "El nombre del servidor no pude contener _ ni -, por favor cambialo con:"
not_ok "sudo hostnamectl hostname $hostname"
exit 1
fi
if ! test -f $authorized_keys; then
not_ok "Primero usa ssh-copy-id desde tu computadora para copiar llaves SSH!"
exit 1
@@ -27,6 +34,15 @@ if test -z "$1"; then
exit 1
fi
if ! grep -q "^FallbackDNS=9.9.9.9" /etc/systemd/resolved.conf; then
ok "Cambiando el proveedor de DNS"
echo "[Resolve]" >/etc/systemd/resolved.conf
echo "FallbackDNS=9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net" >>/etc/systemd/resolved.conf
systemctl restart systemd-resolved
fi
disk=$1
for part in ${disk}?; do