Commit 78697760 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Rafael Monnerat

software/slaprunner: Single-quote jinja-replaced values.

Imperfect: single-quote escaping would be good. But this at least makes
it significantly harder to accidentally end up outside variable assignment.
Users of these values will be added in a later commit.
parent b9773857
...@@ -31,7 +31,7 @@ md5sum = 9db9957f452bda370cb2d5cc2e833e85 ...@@ -31,7 +31,7 @@ md5sum = 9db9957f452bda370cb2d5cc2e833e85
[template-runner-export-script] [template-runner-export-script]
filename = template/runner-export.sh.jinja2 filename = template/runner-export.sh.jinja2
md5sum = 553e67eaca57bf8f375c7479d34f03ec md5sum = d9d139a075969d866fec916092336854
[instance-runner-export] [instance-runner-export]
filename = instance-runner-export.cfg.in filename = instance-runner-export.cfg.in
......
...@@ -7,12 +7,15 @@ umask 077 ...@@ -7,12 +7,15 @@ umask 077
set -e set -e
# Redirect output to log # Redirect output to log
exec > >(tee -ai {{ output_log_file }}) exec > >(tee -ai '{{ output_log_file }}')
exec 2>&1 exec 2>&1
echo -e "\n\n$0 run at : $(date)" echo -e "\n\n$0 run at : $(date)"
srv_directory={{ directory['srv'] }} srv_directory='{{ directory["srv"] }}'
backup_directory='{{ directory["backup"] }}'
etc_directory='{{ directory["etc"] }}'
tmp_directory='{{ directory["tmp"] }}'
sync_element () { sync_element () {
path=$1 path=$1
...@@ -63,8 +66,8 @@ fi ...@@ -63,8 +66,8 @@ fi
cd {{ directory['backup'] }} && find -type f ! -name backup.signature -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature cd {{ directory['backup'] }} && find -type f ! -name backup.signature -print0 | xargs -0 sha256sum | LC_ALL=C sort -k 66 > backup.signature
# Check that export didn't happen during backup of instances # Check that export didn't happen during backup of instances
tmp_backup_sum=$(mktemp -p {{ directory['tmp'] }}) tmp_backup_sum=$(mktemp -p "$tmp_directory")
tmp_filtered_signature=$(mktemp -p {{ directory['tmp'] }}) tmp_filtered_signature=$(mktemp -p "$tmp_directory")
remove_tmp_files () { remove_tmp_files () {
rm $tmp_backup_sum rm $tmp_backup_sum
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment