support multiple sources
parent
6d8109d9a0
commit
6bbe478ef1
|
@ -20,9 +20,10 @@ fi
|
|||
|
||||
KNOWN_HOSTS="${KNOWN_HOSTS:=${PLUGIN_KNOWN_HOSTS}}"
|
||||
|
||||
SOURCE="${SOURCE:-${PLUGIN_SOURCE}}"
|
||||
if [ -z "$SOURCE" ]; then
|
||||
echo "'source' must be specified"
|
||||
SOURCES="${SOURCES:-${PLUGIN_SOURCES}}"
|
||||
SOURCES=$(echo "$SOURCES" | tr ',' ' ')
|
||||
if [ -z "$SOURCES" ]; then
|
||||
echo "specify at least one source"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -48,4 +49,7 @@ known_hosts_file="${HOME}/.ssh/known_hosts"
|
|||
# run rsync
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
exec rsync $ARGS "${SOURCE}" "${USER}"@"${HOST}":"${TARGET}"
|
||||
for SOURCE in $SOURCES; do
|
||||
echo "copying '$SOURCE' to '$TARGET'"
|
||||
rsync $ARGS "${SOURCE}" "${USER}"@"${HOST}":"${TARGET}"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue