17 lines
346 B
Plaintext
Raw Normal View History

2020-05-10 13:33:06 +02:00
#!/bin/sh
used() {
2020-05-13 15:07:01 +02:00
df -h "$1" | awk 'NR==2 { print $3 "/" $2 " GB" }' | sed 's/G\//\//g;s/G / /g'
2020-05-10 13:33:06 +02:00
}
2021-01-19 20:56:51 +01:00
server_used() {
ssh homeserver df -h | grep '/dev/mapper/md0-crypt' | \
awk '{print $3 "/" $2 " GB" }' | sed 's/G\//\//g;s/G / /g'
}
2020-05-10 13:33:06 +02:00
root="$(used /)"
home="$(used /home)"
2021-01-19 20:56:51 +01:00
server="$(server_used)"
2020-05-10 13:33:06 +02:00
2021-01-19 20:56:51 +01:00
echo "/ $root,  $home,  $server"