bash variable set default value

Yeaaa :-) Yesterday i've found a nice way to set an default value for bash variables.
I use this way if parameter 1 isn't assigned by the user. Here a small example:

If $1 isn't assigned by the user the default is set as value of $ip.

Send your comment by mail.