#!/bin/bash #monitor java&nginx basepath=$(cd `dirname $0`; pwd) echo "$(date) run monitor" >> $basepath/run_monitor.log j=$(netstat -anp|grep :8443|grep java) if [ -z "$j" ]; then echo "$(date) restart vcm" >> $basepath/monitor.log source /etc/profile cd $basepath/webapps/ java -jar -Dapp.home="$basepath/webapps" vcm.jar fi n=$(netstat -anp|grep :443|grep nginx) if [ -z "$n" ]; then echo "$(date) restart nginx" >> $basepath/monitor.log systemv=$(lsb_release -a | grep Ubuntu) if [ -z "$systemv" ]; then Nginx/nginxhome/sbin/nginx else cd $basepath/Nginx/nginxhome/sbin ./nginx fi fi
java不用nginx可以吗,Linux脚本监听java和nginx是否运行,如果未运行则运行起来(centos+ubuntu可用)...
最新推荐文章于 2023-08-28 17:02:30 发布