Use WS instead of / in tsp/jobs/watch_diskspace.sh 96/83896/10
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Mon, 1 Aug 2016 07:46:07 +0000 (09:46 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 6 Dec 2016 15:37:14 +0000 (16:37 +0100)
Manual configuration was required for this script to use proper value.
Now it gets it automatically.

Change-Id: Icd0881ba05bafe120387f159fbb29c5c604d8a27
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/jobs/watch_diskspace.sh

index b4acd1f..0ea233c 100755 (executable)
@@ -20,9 +20,8 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
 
 . "${TSP_DIR}/common.sh"
 
-# Assume workspaces are stored on root partition.
-# Get diskspace usage for root mountpoint.
-PER="$(df -Ph | grep -o "[0-9][0-9]%.*/$")"
+# Get diskspace usage for filesystem storing workspaces.
+PER="$(df -P "${WS}" | grep -o "[0-9][0-9]%.*$")"
 # Leave only numerical value.
 PER="${PER%\%*}"
 if [ "$PER" -ge 70 ]