Skip to content

Instantly share code, notes, and snippets.

@hardyoyo
Created March 19, 2015 20:13
Show Gist options
  • Save hardyoyo/1bc805a11a9472a84e00 to your computer and use it in GitHub Desktop.
Save hardyoyo/1bc805a11a9472a84e00 to your computer and use it in GitHub Desktop.
A simple little script that beeps your terminal when Tomcat is done booting up
#!/bin/bash
# This silly command just polls for port 8080 to be available, and as soon as it is, calls beep and exits
# It is especially useful in terminals that support a visual bell, such as Terminator, or PuTTY
red='\033[0;31m'
yellow='\033[1;33m'
NC='\033[0m' # No Color
until netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".8080"'
do
#wait two seconds
sleep 2
done
# beep command courtesy of https://github.com/johnath/beep/
beep
echo
echo -e "${yellow}---> TOMCAT BOOTED SUCESSFULLY!${NC}"
echo
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment