mirror of
https://github.com/anten-ka/gotelegram_pro.git
synced 2026-05-19 16:46:03 +00:00
v2.5.0: redesign local admin and repair stats
This commit is contained in:
13
lib/stats.sh
13
lib/stats.sh
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user