From fad8de9d4ecd5b5b6234c813c5502ca6b96e9b31 Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 5 Sep 2020 14:04:37 +0100 Subject: [PATCH] add pull-from script --- pull-from.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pull-from.sh b/pull-from.sh index 829303e..acf3593 100755 --- a/pull-from.sh +++ b/pull-from.sh @@ -1,3 +1,23 @@ #!/bin/sh +_target="$1" +if ! [ "$_target" = local ] && ! [ "$_target" = remote ] ; then + echo "Error: must specify 'local' or 'remote' target" + exit 1 +fi + +echo "Loading $_target configuration" + +# source our config files +for _file in ./config/$_target/* ; do + [ -e "$_file" ] || continue + . "$_file" +done + +# check we have ssh access +[ -z "$ssh" ] && echo "Error: no ssh configuration specified" && exit 5 + +if [ -n "$wp_user" ] ; then + . ./scripts/export-wp.sh +fi