Skip to content

Commit

Permalink
add: cekonline
Browse files Browse the repository at this point in the history
  • Loading branch information
gojigeje committed May 31, 2014
1 parent a7120e7 commit e191977
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tweet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ getJam() {
# getjam=$(date +'%H:%M:%S')
getjam=$(date +'%H:%M')
}
cekonline() {
if ! eval "ping -c 1 8.8.4.4 -w 2 > /dev/null 2>&1"; then
echo "ERROR: Nggak online!"
exit 1
fi
}

post_tweet() {
if [[ ! -z "$tweet_status" ]]; then
Expand All @@ -50,6 +56,7 @@ post_tweet() {
fi
}

cekonline
if [[ -z "$1" ]]; then
setup
"$aksi"_main
Expand Down

0 comments on commit e191977

Please sign in to comment.