homeproxy-hiddify/root/etc/homeproxy/scripts/clean_log.sh
Andrevich 4f3511fdaf Switch sing-box to hiddify-core
Migrate the project from sing-box to hiddify-core across packaging, init scripts, UI and runtime helpers. Removed sing-box package dependency from build/IPK/Makefile and updated GitHub Actions usages (checkout/upload-artifact pinned to v4). UI and status/log viewers now reference hiddify-c/hiddify-core and log filenames were renamed. init.d was rewritten to use /usr/bin/hiddify-core, load client config from /etc/homeproxy/hiddify-c.json, simplify routing/tproxy setup, adjust dnsmasq handling, and run hiddify-c via procd; log cleaner and ACL/ucode RPC checks were updated accordingly. Overall this change migrates runtime/service names, config paths and version parsing to hiddify-core.
2026-05-12 23:47:25 +04:00

18 lines
444 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2022-2023 ImmortalWrt.org
NAME="homeproxy"
log_max_size="50" #KB
main_log_file="/var/run/$NAME/$NAME.log"
hiddifyc_log_file="/var/run/$NAME/hiddify-c.log"
while true; do
sleep 180
for i in "$main_log_file" "$hiddifyc_log_file"; do
[ -s "$i" ] || continue
[ "$(( $(ls -l "$i" | awk -F ' ' '{print $5}') / 1024 >= log_max_size))" -eq "0" ] || echo "" > "$i"
done
done