Created
November 10, 2019 17:33
-
-
Save kngeno/fea1f2c5e6a45fe4609c082e21a1b5de to your computer and use it in GitHub Desktop.
A bashscript to restart tomcat8 using a cronjob
This file contains hidden or 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
#!/usr/bin/env bash | |
URL='https://<url or domain>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonode:ken_adm&maxFeatures=50&outp$ | |
# only output error messages | |
curl -s -S -f $URL > /dev/null | |
if [ $? -ne 0 ]; then | |
date | |
echo Restarting Tomcat8 service | |
sudo /etc/init.d/tomcat8 restart | |
echo KiWASH GeoServer Instance is restarting! | mutt -s "KiWASH GeoServer Instance" [email protected] | |
echo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment