Adding a host with dynamical IP address to firewall objects

this code looks logically correct but syntacticly a little shakey - ive updated it to the following - add your hostname

myhost=‘my hostname’
myhostip=$(dig +short myhost) old=(db hosts getprop myhost IpAddress)
if [ “$old” != “$myhostip” ]
then db hosts setprop $myhost IpAddress $myhostip
echo signal-event firewall-objects-modify
fi