My code blocks the tomcat port when we start up tomcat because I don't want tomcat answering web request until it's 100% up.
At the end of the rc script it tail catalina.out for you and returns the lines to your screen.
I have it wait for the "Server startup" line and when it sees the server startup line it calls the function to remove all the
iptables block lines I've created.
removing_all_iptables_blocks() {
# List all the current iptables rules
# grep just the INPUT/OUTPUT chain DROP's
# ignore any ipsets ('match-set')
# loop through them and remove them
iptables-save |egrep -o 'INPUT.*DROP|OUTPUT.*DROP' |grep -v match-set | while read a
do
/sbin/iptables -D $a
done
}
...
tail -f /usr/local/tomcat/default/logs/catalina.out | while read LOGLINE
do
echo "${LOGLINE}"
[[ "${LOGLINE}" == *"Server startup in"* ]] && removing_all_iptables_blocks
done
echo "Tomcat is started"
bash code to tail a file and return the lines, but if you hit a given line, execute a function
-
The "too privileged to wear a mask" girl
I can't post this on Facebook because it has too many words in it that would trigger FB's censorship bots. Tonight, before going to the gym, I…
-
Apparently you can not say "dirty woman" on Facebook either
Taken from a friends FB violation, apparently you can not say "dirty woman" either or that will trigger the FB Censorship bots.
-
On Cancel Culture: Why hasn't Disney been canceled?
(( I'm writing this over here on LJ because it has too many "keywords" that could trigger the Censorship Bots over on Facebook. ))…
- Post a new comment
- 0 comments
- Post a new comment
- 0 comments