36 lines
654 B
Bash
36 lines
654 B
Bash
#! /bin/sh
|
|
#
|
|
|
|
set -x
|
|
if [ "$#" -eq 0 ] || [ "$#" -gt 1 ]; then
|
|
echo takes only one argument
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -e "${1}" ]; then
|
|
echo cannot find "${1}"
|
|
exit 1
|
|
fi
|
|
|
|
# shellcheck source=./env_files/checkdiff-example.env
|
|
. "${1}"
|
|
|
|
remote_copy_path=$(mktemp -d)
|
|
rsync \
|
|
--archive \
|
|
--checksum \
|
|
--human-readable \
|
|
"${REMOTE_SSH_STRING}":"${REMOTE_ROOT_PATH}${FOLDER_PATH}/" \
|
|
"${remote_copy_path}"
|
|
|
|
local_copy_path=$(mktemp -d)
|
|
rsync \
|
|
--archive \
|
|
--checksum \
|
|
--exclude-from="${EXCLUDEFILE_PATH}" \
|
|
--human-readable \
|
|
"${LOCAL_ROOT_PATH}${FOLDER_PATH}/" \
|
|
"${local_copy_path}"
|
|
|
|
kdiff3 "${local_copy_path}" "${remote_copy_path}"
|