[deployiso] : add function to reconnect

Signed-off-by: Ste74 <stefano@manjaro.org>
This commit is contained in:
Ste74 2018-03-11 16:45:27 +01:00
parent 16e573d8ac
commit 050066781e

View file

@ -47,9 +47,20 @@ prepare_transfer(){
}
sync_dir(){
cont=1
max_cont=10
prepare_transfer "$1"
msg "Start upload [%s] ..." "$1"
while [[ $count != $max_cont ]]; do
rsync ${rsync_args[*]} ${src_dir}/ ${url}/${target_dir}/
if [[ $? != 0 ]]; then
cont=$(($cont + 1))
msg "Failed to upload [%s] now try again: try $cont of $max_cont" "$1"
sleep 2
else
cont=10
msg "Done upload [%s]" "$1"
show_elapsed_time "${FUNCNAME}" "${timer_start}"
fi
done
}