summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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}" | \