From 6e784be6d96577629069e94ddeb1b63b02af8929 Mon Sep 17 00:00:00 2001 From: Matt Palmer Date: Mon, 21 Sep 2015 13:47:48 +1000 Subject: [PATCH] Only check resources on bootstrap / rebuild There's no reason to make sure there's enough diskspace or memory unless we're building a container. --- launcher | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/launcher b/launcher index db203c3..9038f8f 100755 --- a/launcher +++ b/launcher @@ -152,9 +152,10 @@ prereqs() { exit 1 fi - # 6. sufficient available resources - # 6a. Memory - # +} + +check_resources() { + # Memory resources="ok" avail_mem="$(LANG=C free -m | grep '^Mem:' | awk '{print $2}')" if [ "$avail_mem" -lt 900 ]; then @@ -179,7 +180,7 @@ prereqs() { fi fi - # 6b. Disk space + # Disk space free_disk="$(df /var | tail -n 1 | awk '{print $4}')" if [ "$free_disk" -lt 5000 ]; then resources="insufficient" @@ -465,6 +466,8 @@ run_start(){ run_bootstrap(){ + check_resources + host_run get_ssh_pub_key -- 2.25.1