# but it happened too late in the shutdown process.
sudo dd of=/etc/systemd/system/keyscripton.service <<'EOF'
[Unit]
-Description=Turn on automatic decryption of drives on boot
+Description=keyscripton
# This is triggered by reboot and when keyscriptoff stops.
# tried using graphical.target, but it made my display manager restart before rebooting.
sudo dd of=/etc/systemd/system/keyscriptoff.service <<'EOF'
[Unit]
-Description=Turn off automatic decryption of drives on boot
+Description=keyscriptoff
[Service]
Type=oneshot
echo $HOSTNAME > /etc/hostname
hostname -F /etc/hostname
fi
+# office vpn dhcp adds to /etc/resolv.conf search office.fsf.org which
+# makes that be #1 priority, which makes dnsmasq resolve that for
+# unqualified hosts first, which means we skip the hosts file. Ya, its
+# kinda dumb, but it is what it is. There is a dnsmasq config option to
+# override it too, but this seems simpler.
sudo sed -i --follow-symlinks -f - /etc/hosts <<EOF
-\$a 127.0.1.1 $HOSTNAME.b8.nz $HOSTNAME
+\$a 127.0.1.1 $HOSTNAME.b8.nz $HOSTNAME.office.fsf.org $HOSTNAME
/^127\.0\.1\.1/d
EOF