Release LanUps 0.1.2 with native installers and monitoring updates

This commit is contained in:
tongtong committed 2026-11-28 21:18:14 +08:00
1 parent 90c57f020f
commit 5bdc79d8e4
30 files changed
+751 -270

No files matched your search

+21 -3
View File
@@ -2,13 +2,31 @@
# Sourced by OpenWrt hotplug. A separate process owns the retry lock.
case "${ACTION:-}:${PRODUCT:-}" in
add:665/5161/*|add:0665/5161/*)
if [ -f /etc/lanups/pending ] && [ -n "${DEVNAME:-}" ]; then
if [ -n "${DEVNAME:-}" ]; then
(
lock=/var/run/lanups-router-setup.lock
mkdir "$lock" 2>/dev/null || exit 0
trap 'rmdir "$lock"' EXIT
sleep 2
LANUPS_SKIP_PACKAGES=1 /usr/sbin/lanups-router 2>&1 | logger -t lanups-router
sleep 3
if [ -f /etc/lanups/pending ]; then
LANUPS_SKIP_PACKAGES=1 /usr/sbin/lanups-router 2>&1 | logger -t lanups-router
exit
fi
[ ! -e /var/run/killpower ] && [ ! -e /var/run/nut/disable-hotplug ] || exit 0
case "$(uci -q get nut_server.h1000m.driver)" in
blazer_usb|nutdrv_qx) ;;
*) exit 0 ;;
esac
case "$DEVNAME" in bus/usb/*) ;; *) exit 0 ;; esac
[ -c "/dev/$DEVNAME" ] || exit 0
chown nut:nut "/dev/$DEVNAME" && chmod 0660 "/dev/$DEVNAME" || exit 1
for check in 1 2 3; do
upsc h1000m@127.0.0.1 ups.status >/dev/null 2>&1 && exit 0
sleep 2
done
[ ! -e /var/run/killpower ] && [ ! -e /var/run/nut/disable-hotplug ] || exit 0
logger -t lanups-router 'H1000M reconnected but NUT is offline; restarting nut-server'
/etc/init.d/nut-server restart
) </dev/null >/dev/null 2>&1 &
fi
;;