mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 20:03:56 +08:00
🔥 Sync 2026-09-29 06:58:20
This commit is contained in:
1 parent
498fa20885
commit
37d63c09a5
22 files changed
+459
-121
No files matched your search
@@ -9,7 +9,7 @@ LUCI_DEPENDS:=+tailscale +jshn +curl +jq +flock
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=1.2.17
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
# Keep UCI configs as ordinary package data. The pre-install hook snapshots an
|
||||
# existing configuration before extraction; the UCI-defaults script restores it
|
||||
@@ -43,7 +43,8 @@ disable_legacy_hotplug() {
|
||||
|
||||
disable_legacy_hotplug || exit 1
|
||||
|
||||
[ -f /etc/config/tailscale ] || exit 0
|
||||
# 若系统内无任何相关配置文件,说明是全新安装,直接退出让包管理器正常解压释放默认配置
|
||||
[ -f /etc/config/tailscale ] || [ -f /etc/config/tailscale_openclash ] || [ -f /etc/config/tailscale_policy_routing ] || exit 0
|
||||
[ -f "$${state_dir}/.complete" ] && exit 0
|
||||
|
||||
clear_state_dir() {
|
||||
@@ -55,20 +56,26 @@ clear_state_dir() {
|
||||
|
||||
clear_state_dir "$${state_dir}" || exit 1
|
||||
clear_state_dir "$${state_pending}" || exit 1
|
||||
|
||||
umask 077
|
||||
mkdir "$${state_pending}" || exit 1
|
||||
chmod 700 "$${state_pending}" || exit 1
|
||||
cp /etc/config/tailscale "$${state_pending}/tailscale" || exit 1
|
||||
|
||||
if [ -f /etc/config/tailscale ]; then
|
||||
cp /etc/config/tailscale "$${state_pending}/tailscale" || exit 1
|
||||
fi
|
||||
|
||||
if [ -f /etc/config/tailscale_openclash ]; then
|
||||
cp /etc/config/tailscale_openclash "$${state_pending}/tailscale_openclash" || exit 1
|
||||
else
|
||||
: >"$${state_pending}/tailscale_openclash.absent" || exit 1
|
||||
fi
|
||||
|
||||
if [ -f /etc/config/tailscale_policy_routing ]; then
|
||||
cp /etc/config/tailscale_policy_routing "$${state_pending}/tailscale_policy_routing" || exit 1
|
||||
fi
|
||||
|
||||
: >"$${state_pending}/.complete" || exit 1
|
||||
mv "$${state_pending}" "$${state_dir}" || exit 1
|
||||
|
||||
exit 0
|
||||
endef
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ LUCI_INDEX_CACHE="${LUCI_INDEX_CACHE:-/tmp/luci-indexcache}"
|
||||
|
||||
cleanup_upgrade_state() {
|
||||
rm -f "$UPGRADE_STATE_DIR/tailscale" "$UPGRADE_STATE_DIR/tailscale_openclash" \
|
||||
"$UPGRADE_STATE_DIR/tailscale_openclash.absent" "$UPGRADE_STATE_DIR/tailscale_policy_routing" \
|
||||
"$UPGRADE_STATE_DIR/tailscale_policy_routing" \
|
||||
"$UPGRADE_STATE_DIR/.complete"
|
||||
rmdir "$UPGRADE_STATE_DIR" 2>/dev/null || true
|
||||
}
|
||||
@@ -47,20 +47,18 @@ cleanup_legacy_adguard_dns_service() {
|
||||
fi
|
||||
|
||||
cp -p "$LEGACY_ADGUARD_DNS_INIT" "$backup_dir/init" || return 1
|
||||
|
||||
for link in "$LEGACY_ADGUARD_DNS_RC_DIR"/*tailscale-adguard-dns; do
|
||||
[ -e "$link" ] || [ -L "$link" ] || continue
|
||||
rm -f "$link" || return 1
|
||||
done
|
||||
|
||||
mv "$LEGACY_ADGUARD_DNS_INIT" "$backup_dir/tailscale-adguard-dns.disabled" || return 1
|
||||
}
|
||||
|
||||
if [ -f "$UPGRADE_STATE_DIR/.complete" ]; then
|
||||
restore_upgrade_config "$UPGRADE_STATE_DIR/tailscale" /etc/config/tailscale || exit 1
|
||||
if [ -f "$UPGRADE_STATE_DIR/tailscale_openclash.absent" ]; then
|
||||
rm -f /etc/config/tailscale_openclash
|
||||
else
|
||||
restore_upgrade_config "$UPGRADE_STATE_DIR/tailscale_openclash" /etc/config/tailscale_openclash || exit 1
|
||||
fi
|
||||
restore_upgrade_config "$UPGRADE_STATE_DIR/tailscale_openclash" /etc/config/tailscale_openclash || exit 1
|
||||
restore_upgrade_config "$UPGRADE_STATE_DIR/tailscale_policy_routing" /etc/config/tailscale_policy_routing || exit 1
|
||||
cleanup_upgrade_state
|
||||
elif [ -d "$UPGRADE_STATE_DIR" ]; then
|
||||
|
||||
Reference in new issue
Block a user