IPv6 fix in gencode scripts.

This commit is contained in:
Darko Poljak 2016-11-02 13:55:25 +01:00
parent ca9dd7338a
commit 4ddf6557e3
4 changed files with 42 additions and 5 deletions

View file

@ -66,8 +66,17 @@ destination_upload="\$($__remote_exec $__target_host "mktemp $tempfile_template"
DONE
if [ "$upload_file" ]; then
echo upload >> "$__messages_out"
# IPv6 fix
case "${__target_host}" in
*:*)
my_target_host="[${__target_host}]"
;;
*)
my_target_host="${__target_host}"
;;
esac
cat << DONE
$__remote_copy "$source" "${__target_host}:\$destination_upload"
$__remote_copy "$source" "${my_target_host}:\$destination_upload"
DONE
fi
# move uploaded file into place

View file

@ -43,7 +43,16 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then
echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}"
# IPv6 fix
case "${__target_host}" in
*:*)
my_target_host="[${__target_host}]"
;;
*)
my_target_host="${__target_host}"
;;
esac
echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}"
fi # basepresent=NONE
fi # state=present

View file

@ -39,7 +39,16 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then
echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}"
# IPv6 fix
case "${__target_host}" in
*:*)
my_target_host="[${__target_host}]"
;;
*)
my_target_host="${__target_host}"
;;
esac
echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}"
fi # basepresent=NONE
fi # state=present

View file

@ -59,12 +59,22 @@ case $uname in
;;
esac
# IPv6 fix
case "${__target_host}" in
*:*)
my_target_host="[${__target_host}]"
;;
*)
my_target_host="${__target_host}"
;;
esac
if [ -n "${cksum}" ]; then
if [ ! "\${currentSum}" = "${cksum}" ]; then
$__remote_copy "${source}" "$__target_host:${rcvar}.new"
$__remote_copy "${source}" "${my_target_host}:${rcvar}.new"
fi
else # File just doesn't exist yet
$__remote_copy "${source}" "$__target_host:${rcvar}.new"
$__remote_copy "${source}" "${my_target_host}:${rcvar}.new"
fi
EOF