4 Commits

Author SHA1 Message Date
taamarin
9f479cd546 fix(ctr): sanitize last_check_time, safe return, and add alt SSID method 2025-09-08 00:13:29 +07:00
taamarin
f61566bb2a refactor(scripts): simplify inotify & utils with busybox awk and case logic
- Replaced awk with busybox awk for better compatibility on Android.
- Simplified logging function indentation in ctr.inotify.
- Added clean_old_logs using busybox awk for log retention (24h).
- Unified service control logic:
  - Use case for WiFi blacklist/whitelist matching.
  - Consistent calls to ${scripts_dir}/box.service and ${scripts_dir}/box.iptables.
- Improved SSID retrieval:
  - Use cmd wifi status as primary method.
  - Fallback to iwconfig when available.
- Updated is_allowed_wifi:
  - Convert array → comma-separated string internally.
  - Trim spaces on SSID and list entries before comparison.
- Removed unused service_script and iptables_script vars.
- More descriptive log outputs for network events.

This refactor reduces duplication, improves Android compatibility,
and makes WiFi service control logic more maintainable.
2025-08-23 09:03:36 +07:00
taamarin
5378a141ee fix(network-switch): improve WiFi SSID list handling
- Changed log file path from Networkswitch_debug.log to netswitch.log
- Updated WiFi SSID check to properly handle array values from settings.ini
- Modified is_allowed_wifi to accept array arguments instead of comma-separated strings
- Adjusted calls to is_allowed_wifi in ctr.inotify to pass array correctly
2025-08-21 14:24:40 +07:00
taamarin
b8a51ee1c2 feat: introduce network-based service control with Wi-Fi/SSID options 2025-08-16 14:46:01 +07:00