Skip to content

Commit

Permalink
Merge pull request #3 from opentechinstitute/logrotate
Browse files Browse the repository at this point in the history
Switching from logfile to central syslog for debug
  • Loading branch information
jheretic committed Oct 9, 2013
2 parents c6cf4d9 + dc19487 commit 6a699be
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bin/commotion-bigboard-send
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh
# turn off debugging by default, change to 1 for debug log.
debug=0
logfile='/var/log/commotion-dash.log'

curl=$(which curl)

Expand All @@ -24,16 +23,15 @@ if [ $enabled == 'true' ];then
bb_host=$(echo "$bb_host" | sed -e 's/http:\/\///')
bb_listener_url="http://$bb_host/$bb_listener_script_path"
if [ "$debug" -eq 1 ]; then
echo "Bigboard enabled." >> "$logfile"
echo "$bb_listener_url" >> "$logfile"
printf "\n\n" >> "$logfile"
logger -t commotion.dash.bigboard-send -s "Bigboard enabled"
logger -t commotion.dash.bigboard-send -s "$bb_listener_url"
fi
"$curl" -d "json=$node_json" "$bb_listener_url"
exit 0
# bigboard isn't enabled. just exit
else
if [ "$debug" -eq 1 ]; then
echo "Bigboard disabled"
logger -t commotion.dash.bigboard-send -s "Bigboard disabled"
fi
exit 1
fi

0 comments on commit 6a699be

Please sign in to comment.