29cf67154a
基于 v46 正式版(mt76)只恢复 UI 层: - luci-theme-argon 2.4.3: local-background-wins 登录页 + bg1.jpg fallback - luci-app-argon-config: 去 ui.changes.apply, ACL mutator 移 write - luci-app-wgtunnel: rpcd ucode 后端(get/status/prepare/apply/rollback/reconnect), JSONMap 前端, 60s 一次性 token, 快照回滚, 无全局 network ACL - luci-app-tr3000-status: 只读 rpcd ucode + 5s 轮询仪表盘 - tools/: audit_ui_packages.py + install_preview.sh + rollback_watchdog.sh - docs/: 开发经历与翻车记录 + 固件哈希记录 固件本体(含烤入 WG 私钥/PSK)不入 git, 仅 K 盘保存. kernel 成员与 v46 byte-identical; 尚未刷机.
32 lines
1.7 KiB
Bash
32 lines
1.7 KiB
Bash
#!/usr/bin/env bash
|
|
# Preview install for the Link Health read-only plugin only.
|
|
# Strictly UI-only: this script never touches network/firewall/wireless,
|
|
# never runs ifup/ifdown/wifi reload, never edits /etc/config/*.
|
|
#
|
|
# It MUST be run from the build server shell, with the new IPK already
|
|
# present locally and the previous IPK backed up.
|
|
|
|
set -euo pipefail
|
|
|
|
PKG_NAME="luci-app-tr3000-status"
|
|
NEW_IPK="${1:?usage: install_preview.sh path/to/luci-app-tr3000-status_<ver>_all.ipk}"
|
|
ROUTER="${ROUTER:-root@192.168.1.2}"
|
|
BACKUP_DIR="/root/.v46.1-preview/luci-app-tr3000-status"
|
|
TIMESTAMP="$(date +%Y%m%d-%H%M%S)"
|
|
|
|
[ -f "$NEW_IPK" ] || { echo "new ipk not found: $NEW_IPK" >&2; exit 2; }
|
|
|
|
echo "[info] target router: $ROUTER"
|
|
echo "[info] backup dir: $BACKUP_DIR/$TIMESTAMP"
|
|
|
|
ssh -o BatchMode=yes "$ROUTER" "set -e; mkdir -p '$BACKUP_DIR/$TIMESTAMP'; if opkg list-installed | grep -q '$PKG_NAME'; then opkg list-installed $PKG_NAME | awk '{print \$3}' > '$BACKUP_DIR/$TIMESTAMP/prev_version'; fi; tar -C / -czf '$BACKUP_DIR/$TIMESTAMP/pre_overlay.tar.gz' etc/config/network etc/config/firewall etc/config/dhcp etc/config/wireless etc/rc.local etc/hotplug.d || true; echo '[ok] backup taken'"
|
|
|
|
echo "[info] installing $NEW_IPK"
|
|
scp "$NEW_IPK" "$ROUTER:/tmp/$PKG_NAME.ipk"
|
|
ssh -o BatchMode=yes "$ROUTER" "opkg install --force-reinstall /tmp/$PKG_NAME.ipk && rm -f /tmp/$PKG_NAME.ipk && /etc/init.d/rpcd restart && /etc/init.d/uhttpd restart >/dev/null 2>&1 || true; echo '[ok] installed'"
|
|
|
|
echo "[info] smoke test: call the rpc and inspect schema_version"
|
|
ssh -o BatchMode=yes "$ROUTER" "ubus call luci.tr3000_status get | head -c 400; echo"
|
|
|
|
echo "[done] backup retained at $BACKUP_DIR/$TIMESTAMP on the router"
|