pretty

Monday, January 13, 2014

Check if process is running in bash script

Check if process is running in bash script

#!/bin/bash

if [ -z "$(pgrep mysql)" ]
 then
     echo "Mysql is not running"     
 else
     echo "Mysql is running"
fi

No comments:

Post a Comment