Skip to content

Instantly share code, notes, and snippets.

@atelic
Created May 26, 2015 19:25
Show Gist options
  • Save atelic/e7e1d315db032b1d65b3 to your computer and use it in GitHub Desktop.
Save atelic/e7e1d315db032b1d65b3 to your computer and use it in GitHub Desktop.
A bash script to check if a process is running
#! /bin/bash
process=$1
ps cax | grep $process > /dev/null
if [ $? -eq 0 ]; then
echo "process is running"
else
echo "process is not running"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment