13 lines
294 B
Django/Jinja
13 lines
294 B
Django/Jinja
#!/bin/bash
|
|
# {{ ansible_managed }}
|
|
|
|
# Get disk usage in percent
|
|
pct=$(df --output=pcent $1 | tail -n 1 | tr -d '% ')
|
|
|
|
# Fail if disk is used more than limit
|
|
if [ $pct -gt $2 ]; then
|
|
/usr/bin/curl -s --retry 5 -o /dev/null "${3}/fail"
|
|
else
|
|
/usr/bin/curl -s --retry 5 -o /dev/null "${3}"
|
|
fi
|