nixos/hosts/rescue/menu.sh
rope b960a6ccbf Add FredOS-Rescue: Claude Code rescue USB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 21:22:14 +01:00

41 lines
1.5 KiB
Bash

# Greeting for FredOS-Rescue: shown on every interactive login, and again
# with `menu`.
b=$'\e[1m' y=$'\e[1;33m' d=$'\e[2m' r=$'\e[0m'
# The console is still littered with boot messages at this point.
case "$(tty)" in /dev/tty*) clear ;; esac
printf '%s' "$y"
cat <<'ART'
Fred's
____ _ _ ____
/ ___| | __ _ _ _ __| | ___ | _ \ ___ ___ ___ _ _ ___
| | | |/ _` | | | |/ _` |/ _ \ | |_) / _ \/ __|/ __| | | |/ _ \
| |___| | (_| | |_| | (_| | __/ | _ < __/\__ \ (__| |_| | __/
\____|_|\__,_|\__,_|\__,_|\___| |_| \_\___||___/\___|\__,_|\___|
ART
printf '%s\n' "$r"
cat <<EOF
${b}rescue${r} get online and start Claude (as root)
${b}nmtui${r} networking only (wifi, static IPs)
${b}menu${r} show this screen again
${b}How it goes${r}
1. Type ${b}rescue${r}. Wired connects by itself; otherwise pick a wifi.
2. First start: Claude shows a login URL. Open it on your phone,
sign in, paste the code back here.
3. Tell Claude what broke: what you saw, what changed before it did.
It looks first, and asks before anything touches a disk.
${d}Runs from RAM: nothing here survives a reboot. Your disks are
untouched until you OK a change. Keyboard is UK.${r}
EOF
ips=$(ip -brief -4 addr show scope global 2>/dev/null | awk '{print $3}' | cut -d/ -f1)
if [ -n "$ips" ]; then
printf ' %sRemote:%s ssh root@%s\n\n' "$b" "$r" "$(echo $ips | sed 's/ / or root@/g')"
else
printf ' %sRemote: not online yet; run menu again once connected.%s\n\n' "$d" "$r"
fi