a
This commit is contained in:
@@ -507,8 +507,8 @@ in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
key="${raw_line%%=*}"
|
key="''${raw_line%%=*}"
|
||||||
value="${raw_line#*=}"
|
value="''${raw_line#*=}"
|
||||||
|
|
||||||
key="$(printf '%s' "$key" | tr -d '[:space:]')"
|
key="$(printf '%s' "$key" | tr -d '[:space:]')"
|
||||||
if ! printf '%s' "$key" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$'; then
|
if ! printf '%s' "$key" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$'; then
|
||||||
@@ -516,16 +516,16 @@ in
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
first_char="${value:0:1}"
|
first_char="''${value:0:1}"
|
||||||
last_char="${value: -1}"
|
last_char="''${value: -1}"
|
||||||
if [ "$first_char" = '"' ] && [ "$last_char" = '"' ]; then
|
if [ "$first_char" = '"' ] && [ "$last_char" = '"' ]; then
|
||||||
value="${value:1:${#value}-2}"
|
value="''${value:1:''${#value}-2}"
|
||||||
elif [ "$first_char" = "'" ] && [ "$last_char" = "'" ]; then
|
elif [ "$first_char" = "'" ] && [ "$last_char" = "'" ]; then
|
||||||
value="${value:1:${#value}-2}"
|
value="''${value:1:''${#value}-2}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
value="${value//\\/\\\\}"
|
value="''${value//\\/\\\\}"
|
||||||
value="${value//\"/\\\"}"
|
value="''${value//\"/\\\"}"
|
||||||
printf '%s="%s"\n' "$key" "$value" >> ${serviceEnvFile}
|
printf '%s="%s"\n' "$key" "$value" >> ${serviceEnvFile}
|
||||||
done < "${cfg.secretsFile}"
|
done < "${cfg.secretsFile}"
|
||||||
''}
|
''}
|
||||||
|
|||||||
Reference in New Issue
Block a user