mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-14 17:01:05 +01:00
13 lines
417 B
Django/Jinja
13 lines
417 B
Django/Jinja
#!/bin/sh
|
|
errors=0
|
|
echo "checking disc space use..."
|
|
df
|
|
for disc_use_percent in $(df --output=pcent | sed 1d)
|
|
do
|
|
disc_use_percent_number=$(echo "$disc_use_percent" | sed "s/%//")
|
|
if [ "$disc_use_percent_number" -gt "{{size_percent_disc_space_warning}}" ]; then
|
|
echo "WARNING: $disc_use_percent_number exceeds the limit of {{size_percent_disc_space_warning}}%."
|
|
errors+=1;
|
|
fi
|
|
done
|
|
exit $errors; |