Better test for IPv6 address.

remotes/origin/prometheus
Darko Poljak 9 years ago
parent 4ddf6557e3
commit 6ce6c7830b
  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. 11
      cdist/conf/type/__pf_ruleset/gencode-local

@ -67,14 +67,13 @@ DONE
if [ "$upload_file" ]; then if [ "$upload_file" ]; then
echo upload >> "$__messages_out" echo upload >> "$__messages_out"
# IPv6 fix # IPv6 fix
case "${__target_host}" in echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
*:*) if [ $? -eq 0 ]
then
my_target_host="[${__target_host}]" my_target_host="[${__target_host}]"
;; else
*)
my_target_host="${__target_host}" my_target_host="${__target_host}"
;; fi
esac
cat << DONE cat << DONE
$__remote_copy "$source" "${my_target_host}:\$destination_upload" $__remote_copy "$source" "${my_target_host}:\$destination_upload"
DONE DONE

@ -44,14 +44,13 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then if [ "$basepresent" = "NONE" ]; then
# IPv6 fix # IPv6 fix
case "${__target_host}" in echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
*:*) if [ $? -eq 0 ]
then
my_target_host="[${__target_host}]" my_target_host="[${__target_host}]"
;; else
*)
my_target_host="${__target_host}" my_target_host="${__target_host}"
;; fi
esac
echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}" echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}"
fi # basepresent=NONE fi # basepresent=NONE
fi # state=present fi # state=present

@ -40,14 +40,13 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then if [ "$basepresent" = "NONE" ]; then
# IPv6 fix # IPv6 fix
case "${__target_host}" in echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
*:*) if [ $? -eq 0 ]
then
my_target_host="[${__target_host}]" my_target_host="[${__target_host}]"
;; else
*)
my_target_host="${__target_host}" my_target_host="${__target_host}"
;; fi
esac
echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}" echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}"
fi # basepresent=NONE fi # basepresent=NONE
fi # state=present fi # state=present

@ -60,14 +60,13 @@ case $uname in
esac esac
# IPv6 fix # IPv6 fix
case "${__target_host}" in echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
*:*) if [ $? -eq 0 ]
then
my_target_host="[${__target_host}]" my_target_host="[${__target_host}]"
;; else
*)
my_target_host="${__target_host}" my_target_host="${__target_host}"
;; fi
esac
if [ -n "${cksum}" ]; then if [ -n "${cksum}" ]; then
if [ ! "\${currentSum}" = "${cksum}" ]; then if [ ! "\${currentSum}" = "${cksum}" ]; then

Loading…
Cancel
Save