Skip to content

Instantly share code, notes, and snippets.

@matesio
Created October 29, 2018 10:00
Show Gist options
  • Save matesio/aed1e4832cdd2e1daeb916d4db0a4600 to your computer and use it in GitHub Desktop.
Save matesio/aed1e4832cdd2e1daeb916d4db0a4600 to your computer and use it in GitHub Desktop.
#!/bin/bash
# .ebextensions/datadog/hooks/99stop_datadog.sh
STATUS=`sudo initctl status datadog-agent`
if [[ "$STATUS" == *"datadog-agent stop/waiting"* ]]
then
echo "Agent already stopped"
else
echo "Agent stopping..."
sudo initctl stop datadog-agent
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment