mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Refactored native-backups-cleanup and native-disc-space-check. \n Removed hardcoded values and used parameters instead.
This commit is contained in:
@@ -4,4 +4,4 @@ OnFailure=systemd-email@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash {{disc_space_check_folder}}disc-space-check.sh
|
||||
ExecStart=/bin/bash {{disc_space_check_folder}}disc-space-check.sh {{size_percent_disc_space_warning}}
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#!/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;
|
Reference in New Issue
Block a user