Advertisement
AMONRA75

BASH - AUTO RESTART IF CRASH

Mar 30th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. while true
  4. do
  5.     if ps ax | grep -v grep | grep "connect.php"
  6.     then
  7.         echo "process is running..."
  8.     else
  9.         clear
  10.         date
  11.         echo "process not running, relaunching..."
  12.         php connect.php
  13.     fi
  14.     sleep 10
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement