From c44f44052df7865347ec7fc04b65e223df610ae0 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 20 Jun 2024 16:04:58 +0200 Subject: [PATCH] fix: do not source env variable --- imapsync/usr/local/bin/syncctl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/imapsync/usr/local/bin/syncctl b/imapsync/usr/local/bin/syncctl index e40ed93..666b76f 100755 --- a/imapsync/usr/local/bin/syncctl +++ b/imapsync/usr/local/bin/syncctl @@ -22,7 +22,14 @@ fi action=${1} task_id=${2} -source /etc/imapsync/${task_id}.env +while IFS= read -r line; do + # Trim leading/trailing whitespace + line=$(echo "$line" | xargs) + # Ignore empty lines + [ -z "$line" ] && continue + # Export the variable + export "$line" +done < /etc/imapsync/${task_id}.env if [[ "$action" == "start" ]]; then