From 9a4acc8bc05efcaa6f39c7a4bfded82612aba4b7 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Fri, 23 Jun 2017 20:08:54 -0700 Subject: [PATCH] Do not process a directory as a key file. --- php55/root/outrigger-key.sh | 7 ++++--- php56/root/outrigger-key.sh | 7 ++++--- php70/root/outrigger-key.sh | 7 ++++--- php71/root/outrigger-key.sh | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/php55/root/outrigger-key.sh b/php55/root/outrigger-key.sh index 03346d3..cbcffe4 100755 --- a/php55/root/outrigger-key.sh +++ b/php55/root/outrigger-key.sh @@ -3,9 +3,10 @@ KEY_BASE=/root/.ssh KEY_FILE=$KEY_BASE/outrigger.key -# First check to see if a volume mounted keyfile with a specific name exists -# If that file doesn't exit, was the key passed in via an environment variable? -if [ -e $KEY_FILE ]; then +# First check to see if a volume mounted keyfile with a specific name exists. +# If the source on a bind mount does not exist it will be created as an empty directory. +if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] +then echo "KEY_FILE found. Setting up key..." diff --git a/php56/root/outrigger-key.sh b/php56/root/outrigger-key.sh index 03346d3..cbcffe4 100755 --- a/php56/root/outrigger-key.sh +++ b/php56/root/outrigger-key.sh @@ -3,9 +3,10 @@ KEY_BASE=/root/.ssh KEY_FILE=$KEY_BASE/outrigger.key -# First check to see if a volume mounted keyfile with a specific name exists -# If that file doesn't exit, was the key passed in via an environment variable? -if [ -e $KEY_FILE ]; then +# First check to see if a volume mounted keyfile with a specific name exists. +# If the source on a bind mount does not exist it will be created as an empty directory. +if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] +then echo "KEY_FILE found. Setting up key..." diff --git a/php70/root/outrigger-key.sh b/php70/root/outrigger-key.sh index 03346d3..cbcffe4 100755 --- a/php70/root/outrigger-key.sh +++ b/php70/root/outrigger-key.sh @@ -3,9 +3,10 @@ KEY_BASE=/root/.ssh KEY_FILE=$KEY_BASE/outrigger.key -# First check to see if a volume mounted keyfile with a specific name exists -# If that file doesn't exit, was the key passed in via an environment variable? -if [ -e $KEY_FILE ]; then +# First check to see if a volume mounted keyfile with a specific name exists. +# If the source on a bind mount does not exist it will be created as an empty directory. +if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] +then echo "KEY_FILE found. Setting up key..." diff --git a/php71/root/outrigger-key.sh b/php71/root/outrigger-key.sh index 03346d3..cbcffe4 100755 --- a/php71/root/outrigger-key.sh +++ b/php71/root/outrigger-key.sh @@ -3,9 +3,10 @@ KEY_BASE=/root/.ssh KEY_FILE=$KEY_BASE/outrigger.key -# First check to see if a volume mounted keyfile with a specific name exists -# If that file doesn't exit, was the key passed in via an environment variable? -if [ -e $KEY_FILE ]; then +# First check to see if a volume mounted keyfile with a specific name exists. +# If the source on a bind mount does not exist it will be created as an empty directory. +if [ -e $KEY_FILE ] && [ ! -d $KEY_FILE ] +then echo "KEY_FILE found. Setting up key..."