From db14606dbe0881d4e640a42b0a7d5f356d5c4b2b Mon Sep 17 00:00:00 2001 From: silversword411 Date: Mon, 24 Jun 2024 16:24:14 -0400 Subject: [PATCH] troubleshoot_server: Add helper for resolvconf error --- troubleshoot_server.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/troubleshoot_server.sh b/troubleshoot_server.sh index 9349a3ed..b3dc5834 100644 --- a/troubleshoot_server.sh +++ b/troubleshoot_server.sh @@ -13,6 +13,18 @@ YELLOW='\033[1;33m' RED='\033[0;31m' NC='\033[0m' +# Function to check if a resolvconf is installed +command_exists() { + command -v "$1" &> /dev/null +} + +# Check if resolvconf command is available +if ! command_exists resolvconf; then + echo -e "${RED}Error: resolvconf command not found.${NC}" + echo -e "${YELLOW}Please install it using: ${NC}sudo apt install resolvconf" + exit 1 +fi + # Set date at the top of the troubleshooting script now=$(date) echo -e -------------- $now -------------- | tee -a checklog.log