Last active
September 27, 2024 08:25
-
-
Save alen-z/45550c42d19ba93264661812452aaf00 to your computer and use it in GitHub Desktop.
CUPS check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ANSI color codes | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
check_port_631() { | |
if lsof -i :631 2>/dev/null | grep -qE "LISTEN|:631" || netstat -anu 2>/dev/null | grep -q ":631"; then | |
echo -e "${RED}Port 631 UDP is open. Action required!${NC}" | |
else | |
echo "Port 631 UDP is closed. All good." | |
fi | |
} | |
check_port_631 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment