mirror of
https://github.com/anten-ka/gotelegram_pro.git
synced 2026-05-19 11:26:03 +00:00
fix(stats): add lib/stats.sh to bootstrap + auto-recreate history
Bug report: 'статистика не работает' — submenu_stats showed the 'stats module missing' fallback even though gotelegram-stats.service was active. Root cause: bootstrap.sh FILES[] never included lib/stats.sh, so on every (re)install the file was absent from /opt/gotelegram/lib/ on disk. The running collector was sourcing it from an in-memory bash process from a previous install, but install.sh's `source stats.sh` at menu entry failed silently and hit the 'stats_module_missing' branch. Also: stats_collect silently skipped history writes if stats_history.csv was deleted post-init (only stats_init created it once). Now stats_collect auto-recreates the file with header. - bootstrap.sh: add 'lib/stats.sh' to FILES[] - lib/stats.sh: stats_collect auto-creates HISTORY_FILE if missing Tested live on VPS: show_traffic_stats now outputs real counters (23.1 MB proxy, 10 MB site, 394 KB/s peak).
This commit is contained in:
1
bootstrap.sh
Executable file → Normal file
1
bootstrap.sh
Executable file → Normal file
@@ -76,6 +76,7 @@ FILES=(
|
||||
"lib/backup.sh"
|
||||
"lib/website.sh"
|
||||
"lib/templates_catalog.sh"
|
||||
"lib/stats.sh"
|
||||
"lib/i18n.sh"
|
||||
"lib/lang/en.sh"
|
||||
"lib/lang/ru.sh"
|
||||
|
||||
Reference in New Issue
Block a user