replace var

This commit is contained in:
Cédric Verstraeten
2017-08-02 10:48:30 +02:00
parent f24d915bfa
commit df4c7b2504
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -143,10 +143,11 @@ Create a bash script and copy following script.
Copy following script (make sure the partition is correct, this is the default one for a Raspberry Pi).
partition=/dev/mmcblk0p1
imagedir=/etc/opt/kerberosio/capture/
if [[ $(df -h | grep $partition | head -1 | awk -F' ' '{ print $5/1 }' | tr ['%'] ["0"]) -gt 90 ]];
then
echo "Cleaning disk"
find /etc/opt/kerberosio/capture/ -type f | sort | head -n 100 | xargs -r rm -rf;
find $imagedir -type f | sort | head -n 100 | xargs -r rm -rf;
fi;
Make the script executable.
+2 -1
View File
@@ -135,10 +135,11 @@ Create a bash script and copy following script.
Copy following script (make sure the partition is correct, this is the default one for a Raspberry Pi).
partition=/dev/mmcblk0p1
imagedir=/etc/opt/kerberosio/capture/
if [[ $(df -h | grep $partition | head -1 | awk -F' ' '{ print $5/1 }' | tr ['%'] ["0"]) -gt 90 ]];
then
echo "Cleaning disk"
find /etc/opt/kerberosio/capture/ -type f | sort | head -n 100 | xargs -r rm -rf;
find $imagedir -type f | sort | head -n 100 | xargs -r rm -rf;
fi;
Make the script executable.