feat(netvm): auto-recover and bring up node netns if down when invoking muse-cli

This commit is contained in:
operator
2026-10-05 16:06:25 +00:00
parent 063ed2b47b
commit ea2f208083
+9
View File
@@ -12,6 +12,15 @@ shift
CONF_DIR="$HOME/.config/muse-cli/$NODE"
mkdir -p "$CONF_DIR"
ensure_node_up() {
if ! ip netns list 2>/dev/null | grep -q "^warp-${NODE}\b"; then
echo "Notice: warp-${NODE} network namespace is down; bringing up via netvm-node-up.sh..." >&2
sudo -n "$NETVM_BIN/netvm-node-up.sh" "$NODE" >/dev/null 2>&1 || true
fi
}
ensure_node_up
run_cli() {
export MUSE_CONFIG_DIR="$CONF_DIR"
"$NETVM_BIN/netvm-exec.sh" "$NODE" -- python3 "$NETVM_BIN/muse-cli-inner.py" "$NODE" "$@"