From 507eac1b72875131d0efed442135eab388680bd6 Mon Sep 17 00:00:00 2001 From: rhedia Date: Sat, 11 May 2019 15:28:26 +0200 Subject: [PATCH] Update screen to use bash shell and adapt parse_keyfile output to remove starting $ character and trailing carriage return character : fixes certificate not found error --- src/scripts/entrypoint.sh | 2 +- src/scripts/run_certbot.sh | 2 +- src/scripts/util.sh | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/scripts/entrypoint.sh b/src/scripts/entrypoint.sh index 71d433e..c8cbf07 100644 --- a/src/scripts/entrypoint.sh +++ b/src/scripts/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # When we get killed, kill all our children trap "exit" INT TERM diff --git a/src/scripts/run_certbot.sh b/src/scripts/run_certbot.sh index 346589d..e8c6468 100644 --- a/src/scripts/run_certbot.sh +++ b/src/scripts/run_certbot.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Source in util.sh so we can have our nice tools . $(cd $(dirname $0); pwd)/util.sh diff --git a/src/scripts/util.sh b/src/scripts/util.sh index 2c47c7d..905da3a 100644 --- a/src/scripts/util.sh +++ b/src/scripts/util.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Helper function to output error messages to STDERR, with red text error() { @@ -29,8 +29,9 @@ parse_keyfiles() { # keyfiles), return 1 otherwise keyfiles_exist() { for keyfile in $(parse_keyfiles $1); do - if [ ! -f $keyfile ]; then - echo "Couldn't find keyfile $keyfile for $1" + currentfile=${keyfile//$'\r'/} + if [ ! -f $currentfile ]; then + echo "Couldn't find keyfile $currentfile for $1" return 1 fi done