#!/bin/sh SCRIPT=$(basename $0) USER=your-user-name resolvectl query google.com >/dev/null 2>&1 if [[ $? != 0 ]]; then echo ${SCRIPT}: systemd-resolved has a problem | mail -s $SCRIPT $USER fi
Computer Tips - A script to check systemd-resolved
Date: 2024may18
Language: bash
Q. A script to check systemd-resolved
A. Here's a script you can run from cron to mail you when
there's a problem with systemd-resolved.
Of course, an internet outage could be the cause.