Explorar el Código

Merge branch 'master' into document_generator

Andrea Fazzi hace 5 años
padre
commit
263b1e042b
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  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