From 5c58a5e8e7257d517d6763343f8aba429fcafa1d Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Sat, 30 Nov 2013 02:46:42 +0000 Subject: [PATCH] Add a backup-check to avoid reimporting apps. --- plugins/00_dokku-standard/backup-check | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 plugins/00_dokku-standard/backup-check diff --git a/plugins/00_dokku-standard/backup-check b/plugins/00_dokku-standard/backup-check new file mode 100755 index 000000000..91e7bfb51 --- /dev/null +++ b/plugins/00_dokku-standard/backup-check @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +VERSION="$1" +IMPORT_DIR="$2" +TARGET_DIR="$3" +APPS="$(< $4 )" + +ret=0 + +for app in $APPS; do + if [[ -d $TARGET_DIR/$app ]]; then + ret=1 + echo "Trying to import application $app which already exists." 2>&1 + fi +done + +exit $ret +