Skip to content

Commit

Permalink
added check for apt-get update
Browse files Browse the repository at this point in the history
  • Loading branch information
pgraziano committed Sep 29, 2018
1 parent 09b40b7 commit 98b6164
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 98b6164

Please sign in to comment.