if [$old_ip!=$ip]; then

if [ $old_ip != $ip ]; then

[ はただのコマンド名なので特別扱いはされません。

cat fooをcatfooと書いたらだめなのと同じ理由でだめです。