30 октября 2024
Нет комментариев
function getSingleIfRepeatedTwiceWithSpace($text){ if(preg_match('/^(.+)\s\1$/',$text,$matches)){ return $matches[1]; } return $text; }
function getSingleIfRepeatedTwiceWithSpace($text){ if(preg_match('/^(.+)\s\1$/',$text,$matches)){ return $matches[1]; } return $text; }
Автоматический перезапуск tomcat если он не активен
#!/bin/bash TOMCAT_PID=$(ps -ef | awk '/[t]omcat/{print $2}') echo TOMCAT PROCESSID $TOMCAT_PID if [ -z "$TOMCAT_PID" ] then echo "TOMCAT NOT RUNNING" service tomcat restart else echo "TOMCAT RUNNING" fi