fix: multiple fixes

This commit is contained in:
FUFSoB committed 2026-09-17 18:15:55 +05:00
1 parent ffc7816289
commit 97332c1774
23 files changed
+940 -96

No files matched your search

@@ -7,6 +7,7 @@
routeModeStateFile,
pinnedOutboundFile,
outboundInventoryFile,
runtimeOutboundsDir,
subscriptionCacheDir,
subscriptionCacheHelpersBlock,
mkSubscriptionFetchBlock,
@@ -95,6 +96,16 @@ let
echo "proxy-suite: unknown outbound '$tag'" >&2
exit 1
fi
# Disabled means nothing picks it on its own, a pin included.
case "$tag" in
*/* | . | ..) ;;
*)
if [ -e "${runtimeOutboundsDir}/$tag.disabled" ]; then
echo "proxy-suite: outbound '$tag' is disabled; enable it first: proxy-ctl proxy outbounds enable $tag" >&2
exit 1
fi
;;
esac
mkdir -p "$(dirname "${pinnedOutboundFile}")"
printf '%s\n' "$tag" > "${pinnedOutboundFile}"
# Live switch when the running config exposes a selector; the persisted pin
@@ -147,6 +158,21 @@ let
esac
done
# A pin on a disabled outbound goes with it, so enabling the outbound later does not
# bring the pin back. Here rather than through the unpin unit: disabling is the
# outbounds scope's, pinning the routing scope's.
if [ -r "${pinnedOutboundFile}" ]; then
PINNED="$(tr -d '\r\n[:space:]' < "${pinnedOutboundFile}" 2>/dev/null || true)"
case "$PINNED" in
"" | */* | . | ..) ;;
*)
if [ -e "${runtimeOutboundsDir}/$PINNED.disabled" ]; then
rm -f "${pinnedOutboundFile}"
fi
;;
esac
fi
${restartActiveConfigConsumersBlock}
'';
in