- 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.
- 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
- Added syntax validation for `/data/adb/box/settings.ini` at the start of:
* box.inotify
* box.iptables
* box.service
* box.tool
* ctr.inotify
* start.sh
- If validation fails, an error message is logged to
`/data/adb/box/run/settings_err.log` and the script exits immediately.
- Ensures misconfigured settings.ini do not break runtime scripts.