Initial release: install, uninstall, SmartDNS, web UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Андрей Бобырев
2026-05-24 22:15:37 +03:00
commit bc9355fe40
21 changed files with 2715 additions and 0 deletions

41
init.d/S98smartdns Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/sh
# SmartDNS for Keenetic-Split-DNS (wraps Entware smartdns)
KSD_ETC="/opt/etc/keenetic-split-dns"
CONF="${KSD_ETC}/smartdns.conf"
PIDFILE="/opt/var/run/keenetic-split-dns/smartdns.pid"
LOGDIR="/opt/var/log/keenetic-split-dns"
start() {
mkdir -p "$LOGDIR" "$(dirname "$PIDFILE")"
[ -f "$CONF" ] || return 1
if pidof smartdns >/dev/null 2>&1; then
return 0
fi
smartdns -c "$CONF" -p "$PIDFILE" >/dev/null 2>&1 &
sleep 1
pidof smartdns >/dev/null 2>&1
}
stop() {
if [ -f "$PIDFILE" ]; then
kill "$(cat "$PIDFILE" 2>/dev/null)" 2>/dev/null || true
rm -f "$PIDFILE"
fi
killall smartdns 2>/dev/null || true
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; sleep 1; start ;;
status)
if pidof smartdns >/dev/null 2>&1; then
echo "smartdns running"
exit 0
fi
echo "smartdns stopped"
exit 1
;;
esac
exit 0