From db6e2b10c3500cbcb20e522580fb8d6558f9fd1b Mon Sep 17 00:00:00 2001 From: Kieren Evans Date: Thu, 23 Mar 2017 13:22:16 +0000 Subject: [PATCH] Error and quit if an unset variable is used in functions. Helps avoid `rm -rf ${VAR}/*` wiping /* if $VAR is not set, as it could wipe out mountpoints. --- ubuntu/16.04/usr/local/bin/container | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ubuntu/16.04/usr/local/bin/container b/ubuntu/16.04/usr/local/bin/container index cbbd2b31..bf3e964e 100755 --- a/ubuntu/16.04/usr/local/bin/container +++ b/ubuntu/16.04/usr/local/bin/container @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -e -u TASK=$1 ARGS=( "$@" ) @@ -28,4 +28,4 @@ fi set -- "${ARGS[@]}" shift 1 -"do_$TASK" "$@" \ No newline at end of file +"do_$TASK" "$@"