dispatch-turn.sh (headless turn launcher with TURN_MODEL routing), queue-after.sh (serial gate chain + quota-wall guard), pmo-heartbeat.sh (PMO wake loop), quota-probe-then-chain.sh (post-wall relaunch).
35 lines
1.2 KiB
Bash
Executable File
35 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# root-migrate-coordinate.sh — move ~/.coordinate into _crossfeed/state/rceo (symlink back).
|
|
# Run as root, when RCEO agents are idle (no work-turn screens, PMO/Work between turns):
|
|
# sudo bash ~/.coordinate/scripts/root-migrate-coordinate.sh
|
|
set -euo pipefail
|
|
|
|
[ "$(id -u)" -eq 0 ] || { echo "ERROR: run with sudo"; exit 1; }
|
|
|
|
SRC=/home/reachableceo/.coordinate
|
|
STATE_ROOT=/home/_crossfeed/state
|
|
DEST=$STATE_ROOT/rceo
|
|
LINK=/home/reachableceo/.coordinate
|
|
|
|
if screen -ls 2>/dev/null | grep -q work-turn; then
|
|
echo "ERROR: work-turn screens still running — let them finish first (or --force)"
|
|
[ "${1:-}" = "--force" ] || exit 1
|
|
fi
|
|
|
|
if [ -L "$LINK" ]; then
|
|
echo "Already migrated: $LINK -> $(readlink "$LINK")"; exit 0
|
|
fi
|
|
[ -d "$SRC" ] || { echo "ERROR: $SRC missing"; exit 1; }
|
|
[ -e "$DEST" ] && { echo "ERROR: $DEST already exists — resolve manually"; exit 1; }
|
|
|
|
mkdir -p "$STATE_ROOT"
|
|
mv "$SRC" "$DEST"
|
|
ln -s "$DEST" "$LINK"
|
|
|
|
chgrp -R users "$DEST"
|
|
chmod -R g+rX "$DEST"
|
|
chgrp users "$STATE_ROOT"; chmod g+rx "$STATE_ROOT"
|
|
|
|
echo "OK: state now at $DEST (owner reachableceo, group users read-only)"
|
|
echo "NOTE: ~/projects symlink + all scripts keep working via $LINK"
|