Skip to content

Commit 7ff4964

Browse files
authored
Update wp-post.sh
1 parent 3468957 commit 7ff4964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wordpress/wp-post.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ resolve_host() {
9898
local result=()
9999

100100
# Try to get IPv4 address
101-
ipv4="$(ping -4 -c 1 "$host" | awk -F'[()]' '{print $2}' | head -n 1)"
101+
ipv4="$(ping -4 -c 1 "$host" | grep -oP '(?<=\()[^)]+' | head -n 1)"
102102

103103
# Fallback to find IP
104104
ip_fallback="$(getent hosts "${host}" | awk '{ print $1 }')"

0 commit comments

Comments
 (0)