summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-08-28 22:54:30 +0200
committerErich Eckner <git@eckner.net>2024-08-28 22:54:30 +0200
commit3306e4eb91ce5ad2e095bf7f7ed2d71f852e0889 (patch)
tree3eafabc8fb33d7e92b1b26c9b6ec1f5738ce7c8a
parentb3279b4d3439939502a0decd036815f3139fc43d (diff)
downloadcopyPhotos-master.tar.xz
copyPhotos: erst markieren, dann hochladenHEADmaster
-rwxr-xr-xcopyPhotos78
1 files changed, 39 insertions, 39 deletions
diff --git a/copyPhotos b/copyPhotos
index 026ac6b..992eebb 100755
--- a/copyPhotos
+++ b/copyPhotos
@@ -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}" | \