From 60b29a64a74e525e268c5bdb32fda4f9e225a560 Mon Sep 17 00:00:00 2001 From: Matthias Leutenegger Date: Wed, 3 Jun 2020 08:52:02 +0200 Subject: [PATCH] CHANGE: use solution proposed by @alt4 --- templates/restic_access_Linux.j2 | 2 +- templates/restic_script_Linux.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/restic_access_Linux.j2 b/templates/restic_access_Linux.j2 index 554073d..ca0c313 100644 --- a/templates/restic_access_Linux.j2 +++ b/templates/restic_access_Linux.j2 @@ -4,7 +4,7 @@ # Source this file to work with restic on this host export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }} -export RESTIC_PASSWORD="{{ restic_repos[item.repo].password | regex_escape() }}" +export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}' {% if restic_repos[item.repo].aws_access_key is defined %} export AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }} {% endif %} diff --git a/templates/restic_script_Linux.j2 b/templates/restic_script_Linux.j2 index df46df3..e6f42ea 100644 --- a/templates/restic_script_Linux.j2 +++ b/templates/restic_script_Linux.j2 @@ -4,7 +4,7 @@ # Use this file to create a Backup and prune existing data with one execution. export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }} -export RESTIC_PASSWORD="{{ restic_repos[item.repo].password | regex_escape() }}" +export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}' BACKUP_NAME={{ item.name }} {% if restic_repos[item.repo].aws_access_key is defined %} export AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}