Skip to content

Instantly share code, notes, and snippets.

@joshespi
Created November 30, 2021 22:20
Show Gist options
  • Save joshespi/81f49e47fb0600b16107dc82a621b160 to your computer and use it in GitHub Desktop.
Save joshespi/81f49e47fb0600b16107dc82a621b160 to your computer and use it in GitHub Desktop.
detect if chrome is running
#!/bin/bash
SERVICE="chromium"
if pgrep "$SERVICE" > /dev/null
then
echo "$SERVICE is running"
#for SNMP
echo "0"
else
echo "$SERVICE stopped"
#for SNMP
echo "1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment