op-packages/luci-app-easyconfig-transfer/root/usr/bin/auto_reset_statistics.sh
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

20 lines
368 B
Bash
Executable File

#!/bin/sh
#
# (c) 2025-2026 by Rafał Wabik (IceG) <https://github.com/4IceG>
#
# From eko.one.pl forum
#
DB=/tmp/easyconfig_statistics.json
SDB=/usr/lib/easyconfig/
CURRENT_YEAR=$(date +"%Y")
PREVIOUS_YEAR=$((CURRENT_YEAR - 1))
NEW_ST="easyconfig_statistics_${PREVIOUS_YEAR}.json"
mv "$DB" "$NEW_ST$SDB"
sleep 5
echo "{}" > /tmp/easyconfig_statistics.json
exit 0