Fix shell IPv6 testing (for -e).

This commit is contained in:
Darko Poljak 2016-11-28 08:13:59 +01:00
parent 36244b8a11
commit ca424a34e6
4 changed files with 4 additions and 8 deletions

View file

@ -67,8 +67,7 @@ DONE
if [ "$upload_file" ]; then
echo upload >> "$__messages_out"
# IPv6 fix
echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
if [ $? -eq 0 ]
if $(echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$')
then
my_target_host="[${__target_host}]"
else

View file

@ -44,8 +44,7 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then
# IPv6 fix
echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
if [ $? -eq 0 ]
if $(echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$')
then
my_target_host="[${__target_host}]"
else

View file

@ -40,8 +40,7 @@ basepresent="$(cat "$__object/explorer/basepresent")"
if [ "$state" = "present" ]; then
if [ "$basepresent" = "NONE" ]; then
# IPv6 fix
echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
if [ $? -eq 0 ]
if $(echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$')
then
my_target_host="[${__target_host}]"
else

View file

@ -60,8 +60,7 @@ case $uname in
esac
# IPv6 fix
echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$'
if [ $? -eq 0 ]
if $(echo "${__target_host}" | grep -q -E '^[0-9a-fA-F:]+$')
then
my_target_host="[${__target_host}]"
else