Add cn doctor with mirror auto-failover and restore commands

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
This commit is contained in:
2026-08-24 18:55:08 -04:00
co-authored by Claude Fable 5
parent d1a5ddfd02
commit dd3b893137
3 changed files with 155 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# omarchy:summary=List OmarchyCN configuration backups
# omarchy:examples=omarchycn restore list
set -euo pipefail
source "$OMARCHY_PATH/cn/lib/dev-mirror.sh"
echo "Dev-mirror backups ($CN_DM_BACKUP_ROOT):"
if [[ -d $CN_DM_BACKUP_ROOT ]]; then
for dir in "$CN_DM_BACKUP_ROOT"/*/; do
[[ -d $dir ]] || continue
stamp="${dir%/}"
stamp="${stamp##*/}"
echo " $stamp: $(ls "$dir" | tr '\n' ' ')"
done
else
echo " (none)"
fi
echo "Mirrorlist backups (/etc/pacman.d):"
found="false"
for f in /etc/pacman.d/mirrorlist.omarchycn-bak-*; do
if [[ -e $f ]]; then
echo " ${f##*/}"
found="true"
fi
done
if [[ $found == "false" ]]; then
echo " (none)"
fi