Files
Keenetic-Split-DNS/scripts/apply.sh
Андрей Бобырев bc9355fe40 Initial release: install, uninstall, SmartDNS, web UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 22:15:37 +03:00

29 lines
774 B
Bash
Executable File

#!/bin/sh
# Apply configuration: compile, restart services, netfilter
set -e
KSD_ETC="${KSD_ETC:-/opt/etc/keenetic-split-dns}"
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname "$0")" && pwd)"
"$SCRIPT_DIR/compile-config.sh"
if [ -x /opt/etc/init.d/S98smartdns ]; then
/opt/etc/init.d/S98smartdns restart || /opt/etc/init.d/S98smartdns start
elif [ -x /opt/etc/init.d/S56smartdns ]; then
/opt/etc/init.d/S56smartdns restart || true
fi
if [ -x /opt/etc/init.d/S99ksd-web ]; then
/opt/etc/init.d/S99ksd-web restart || /opt/etc/init.d/S99ksd-web start
fi
NF="/opt/etc/ndm/netfilter.d/010-keenetic-split-dns.sh"
if [ -x "$NF" ]; then
"$NF" restart 2>/dev/null || true
ndm -p netfilter restart 2>/dev/null || true
fi
echo "Applied keenetic-split-dns configuration."
exit 0