diff --git a/mqtt_pub_status.sh b/mqtt_pub_status.sh index 5bad3d4..d75b314 100755 --- a/mqtt_pub_status.sh +++ b/mqtt_pub_status.sh @@ -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"