v2.5.0: redesign local admin and repair stats

This commit is contained in:
Виталий Литвинов
2026-04-24 22:30:09 +03:00
parent 008143a617
commit d9e4831e44
10 changed files with 1521 additions and 391 deletions

View File

@@ -397,7 +397,18 @@ EOF
chmod 644 "$service_file"
systemctl daemon-reload
systemctl enable gotelegram-stats.service
systemctl start gotelegram-stats.service
systemctl restart gotelegram-stats.service
if [[ -f "$CONFIG_FILE" ]] && command -v jq &>/dev/null; then
local tmp
tmp=$(mktemp)
if jq '.stats_enabled = true' "$CONFIG_FILE" > "$tmp" 2>/dev/null; then
mv "$tmp" "$CONFIG_FILE"
chmod 600 "$CONFIG_FILE" 2>/dev/null || true
else
rm -f "$tmp" 2>/dev/null
fi
fi
echo "Сервис gotelegram-stats установлен и запущен" >&2
}