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:
Executable
+31
@@ -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
|
||||
Reference in New Issue
Block a user