mirror of
https://github.com/kmein/niveum
synced 2026-03-17 02:31:09 +01:00
21 lines
482 B
Plaintext
21 lines
482 B
Plaintext
|
|
#!/bin/sh
|
||
|
|
version_file=/etc/niveum/version
|
||
|
|
niveum_dir="$HOME/prog/git/niveum"
|
||
|
|
|
||
|
|
machine_status () {
|
||
|
|
hostname="$1"
|
||
|
|
|
||
|
|
if commit_id="$(ssh "$hostname" cat $version_file 2>/dev/null)"; then
|
||
|
|
machine_status="$(git -C "$niveum_dir" log -1 --oneline "$commit_id")"
|
||
|
|
else
|
||
|
|
machine_status=offline
|
||
|
|
fi
|
||
|
|
|
||
|
|
printf "\033[1m%11s\033[0m %s\n" "$hostname" "$machine_status"
|
||
|
|
}
|
||
|
|
|
||
|
|
for system in "$niveum_dir"/systems/*; do
|
||
|
|
hostname="$(basename "$system")"
|
||
|
|
machine_status "$hostname"
|
||
|
|
done
|