23 lines
770 B
Fish
Executable File
23 lines
770 B
Fish
Executable File
#!/usr/bin/env fish
|
||
# run from your workstation
|
||
|
||
set jump titan-db # alias from ~/.ssh/config (192.168.22.10:2277)
|
||
|
||
# grab host list from titan-db’s ~/.ssh/config
|
||
set nodes (ssh $jump 'grep -E "^Host titan-" ~/.ssh/config | awk "{print \$2}"')
|
||
|
||
for n in $nodes
|
||
echo "=== $n ==="
|
||
# list volumes
|
||
ssh $jump "ssh $n 'ls /dev/longhorn'" 2>/dev/null
|
||
|
||
# look for app.ini or repos inside each volume
|
||
set vols (ssh $jump "ssh $n 'ls /dev/longhorn'" 2>/dev/null)
|
||
for v in $vols
|
||
ssh $jump "ssh $n 'test -e /dev/longhorn/$v && sudo mount -o ro /dev/longhorn/$v /mnt && \
|
||
(ls /mnt/gitea/conf/app.ini 2>/dev/null || true) && \
|
||
(ls /mnt/git/repositories 2>/dev/null || true); sudo umount /mnt'" 2>/dev/null
|
||
end
|
||
end
|
||
|