diff --git a/conf/backup-with-borg.j2 b/conf/backup-with-borg.j2 index 3724024..d2b9f1b 100644 --- a/conf/backup-with-borg.j2 +++ b/conf/backup-with-borg.j2 @@ -15,14 +15,14 @@ filter_hooks() { # Backup system part conf conf=$(yunohost app setting {{ app }} conf) -if [ "$conf" = "true" ] +if [ $conf -eq 1 ] then yunohost backup create $ignore_apps -n auto_conf --method {{ app }}_app --system $(filter_hooks conf) fi # Backup system data data=$(yunohost app setting {{ app }} data) -if [ "$data" = "true" ] +if [ $data -eq 1 ] then yunohost backup create $ignore_apps -n auto_data --method {{ app }}_app --system $(filter_hooks data) fi diff --git a/conf/backup_method.j2 b/conf/backup_method.j2 index dedbdb0..7eef826 100644 --- a/conf/backup_method.j2 +++ b/conf/backup_method.j2 @@ -3,7 +3,7 @@ set -e BORG_PASSPHRASE="{{ passphrase }}" -if grep "{{ server }}" ~/.ssh/known_hosts; then +if ssh-keygen -F "{{ server }}" >/dev/null ; then BORG_RSH="ssh -i /root/.ssh/id_{{ app }}_ed25519 -oStrictHostKeyChecking=yes " else BORG_RSH="ssh -i /root/.ssh/id_{{ app }}_ed25519 -oStrictHostKeyChecking=no "