diff options
author | Erich Eckner <git@eckner.net> | 2024-08-28 22:54:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2024-08-28 22:54:30 +0200 |
commit | 3306e4eb91ce5ad2e095bf7f7ed2d71f852e0889 (patch) | |
tree | 3eafabc8fb33d7e92b1b26c9b6ec1f5738ce7c8a | |
parent | b3279b4d3439939502a0decd036815f3139fc43d (diff) | |
download | copyPhotos-master.tar.xz |
-rwxr-xr-x | copyPhotos | 78 |
1 files changed, 39 insertions, 39 deletions
@@ -113,45 +113,6 @@ tar -cf - "${!jahre[@]}" --xform='s@^\([0-9]\{4\}\)_@\1/\1_@' | \ erg=0 -for ziel in "${ziele[@]}"; do - - host="${ziel%:*}" - verzeichnis="${ziel#*:}" - - pingErg=0 - - pingHost=$( - sed -n '/^Host '"${host#*@}"'$/,/^$/ { - s/^\s\+Hostname \(\S\+\)$/\1/ - T - p - }' ~/.ssh/config - ) - if [ -z "${pingHost}" ]; then - pingHost="${host#*@}" - fi - - ping -c1 "${pingHost}" > /dev/null || \ - pingErg=$? - - ! ${offline_erlaubt} && [ ${pingErg} -gt 1 ] && exit ${pingErg} - - if [ ${pingErg} -eq 0 ] - then - - rsync --progress --ignore-existing -avc "${tmp_dir}/" "${host}:${verzeichnis}/" - - echo "${summen}" | \ - sed 's@^\([0-9a-f]\+ \+\)\([0-9]\{4\}\)_@\1'"${verzeichnis}"'/\2/\2_@' | \ - ssh "${host}" 'sha512sum -c' - - fi - if [ ${pingErg} -gt ${erg} ]; then - erg=${pingErg} - fi - -done - while true do feh -XdF $(printf '%s\n' "${!jahre[@]}" | sort) @@ -233,6 +194,45 @@ do esac done +for ziel in "${ziele[@]}"; do + + host="${ziel%:*}" + verzeichnis="${ziel#*:}" + + pingErg=0 + + pingHost=$( + sed -n '/^Host '"${host#*@}"'$/,/^$/ { + s/^\s\+Hostname \(\S\+\)$/\1/ + T + p + }' ~/.ssh/config + ) + if [ -z "${pingHost}" ]; then + pingHost="${host#*@}" + fi + + ping -c1 "${pingHost}" > /dev/null || \ + pingErg=$? + + ! ${offline_erlaubt} && [ ${pingErg} -gt 1 ] && exit ${pingErg} + + if [ ${pingErg} -eq 0 ] + then + + rsync --progress --ignore-existing -avc "${tmp_dir}/" "${host}:${verzeichnis}/" + + echo "${summen}" | \ + sed 's@^\([0-9a-f]\+ \+\)\([0-9]\{4\}\)_@\1'"${verzeichnis}"'/\2/\2_@' | \ + ssh "${host}" 'sha512sum -c' + + fi + if [ ${pingErg} -gt ${erg} ]; then + erg=${pingErg} + fi + +done + if [ ${erg} -eq 0 ] then echo "${summen}" | \ |