Skip to content

Commit

Permalink
Merge pull request #166 from pgraziano/check-apt-get-update
Browse files Browse the repository at this point in the history
added check for apt-get update
  • Loading branch information
aacole authored Sep 29, 2018
2 parents 09b40b7 + 98b6164 commit 9f9405e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sensu/plugins/check-apt-get-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

if [[ -n $1 ]]; then
export http_proxy=$1
fi

if ! { apt-get update 2>&1 || echo "E: update failed"; } | grep -q '^[WE]:'; then
echo "apt cache update successsful"
exit 0
else
echo "apt cache update failed"
exit 2
fi

0 comments on commit 9f9405e

Please sign in to comment.