Sfoglia il codice sorgente

Merge branch 'master' into document_generator

Andrea Fazzi 5 anni fa
parent
commit
263b1e042b
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      watch.sh

+ 9 - 1
watch.sh

@@ -1,4 +1,12 @@
-#!/bin/sh
+#!/bin/bash
+
+diskFree=$(df -h /dev/sda1 | awk 'NR>1{print $4}')
+value="${diskFree::-1}"
+
+if (( value < 3 )); then
+    docker image prune -a -f
+fi
+
 while inotifywait -r -e modify ./; do
   docker-compose -f compose/karmen/docker-compose.yml down
   docker-compose -f compose/karmen/docker-compose.yml up --build -d