Files
dawnline/package/luci-app-dawnline/root/etc/uci-defaults/90_dawnline
T
Aemeath 70a932b8ea
Build packages / Version (push) Waiting to run
Dawnline 0.3.1
- Find home devices (Bonjour) removed: iOS looks for services over the
  tunnel only under a search domain, and Android and Chromecast only over
  multicast, which WireGuard does not carry. Upgrading removes its server
  option and dnsmasq records
- Home services still show the ports devices announce when umdns runs
2026-10-15 19:01:15 +03:00

49 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
# Dawnline first-run / upgrade housekeeping.
[ -f /etc/config/dawnline ] || cat > /etc/config/dawnline <<'CFG'
config settings 'settings'
option portal_enabled '0'
option portal_port '8443'
option default_device_limit '3'
option hostnames '1'
CFG
chmod 600 /etc/config/dawnline
mkdir -p /etc/dawnline && chmod 700 /etc/dawnline
# Webhook alerts were removed.
uci -q delete dawnline.settings.webhook_url
uci -q delete dawnline.settings.alert
uci -q commit dawnline
rm -f /etc/dawnline/alerts.json
# Backups moved into Settings.
rm -f /www/luci-static/resources/view/dawnline/backups.js
# Portal assets moved out of the web root (served only with a valid code).
rm -rf /usr/share/dawnline/portal/www/assets
# "Find home devices" (0.3.0) is gone: its option and dnsmasq records too.
for s in $(uci -q show dawnline | sed -n 's/^dawnline\.\([^.]*\)\.bonjour=.*/\1/p'); do uci -q delete "dawnline.$s.bonjour"; done
uci -q commit dawnline
if ls /tmp/dnsmasq*.d/dawnline-bonjour.conf >/dev/null 2>&1; then
rm -f /tmp/dnsmasq*.d/dawnline-bonjour.conf /var/run/dawnline/bonjour.json
/etc/init.d/dnsmasq restart 2>/dev/null
fi
# LuCI caches: menu index, and module URLs (?v= follows the opkg status time).
rm -f /tmp/luci-indexcache* /tmp/luci-modulecache/* 2>/dev/null
touch /usr/lib/opkg/status 2>/dev/null
# Cron restarts the agent when it stops ticking (Health → Watchdog).
mkdir -p /etc/crontabs
grep -qs /usr/libexec/dawnline/heartbeat /etc/crontabs/root || {
echo '*/5 * * * * /usr/libexec/dawnline/heartbeat' >> /etc/crontabs/root
/etc/init.d/cron restart 2>/dev/null
}
/etc/init.d/rpcd reload
# A reload keeps LuCI logins but sometimes misses the plugin; restart only then.
sleep 2
ubus list luci.dawnline >/dev/null 2>&1 || { /etc/init.d/rpcd restart; sleep 2; }
/etc/init.d/dawnline enable
/etc/init.d/dawnline restart
exit 0