Change = to ==

This is an if condition, not an assignment
Use Rex to check IPv4 instead of using resolv