IPv6 fix in gencode scripts.

remotes/origin/prometheus
Darko Poljak 9 years ago
parent ca9dd7338a
commit 4ddf6557e3
  1. 11
      cdist/conf/type/__file/gencode-local
  2. 11
      cdist/conf/type/__jail_freebsd10/gencode-local
  3. 11
      cdist/conf/type/__jail_freebsd9/gencode-local
  4. 14
      cdist/conf/type/__pf_ruleset/gencode-local

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save