Skip to content

Commit

Permalink
more db info
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Bakera committed Sep 3, 2024
1 parent 1ba8b99 commit 87d3c7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mqtt_pub_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ mosquitto_pub -h $MQTT_HOST -t $TOPIC/system/uptime/seconds -m "$(cat /proc/upti
# count user
user_count=$(sqlite3 $PROJDIR/testate.db 'select count(*) from db_user')
mosquitto_pub -h $MQTT_HOST -t $TOPIC/user_count -m "$user_count"

# count cards
cards_count=$(sqlite3 $PROJDIR/testate.db 'select count(*) from card')
mosquitto_pub -h $MQTT_HOST -t $TOPIC/cards_count -m "$cards_count"

# project count
project_count=$(sqlite3 $PROJDIR/testate.db 'select count(distinct project_name) from card')
mosquitto_pub -h $MQTT_HOST -t $TOPIC/project_count -m "$project_count"

0 comments on commit 87d3c7e

Please sign in to comment.