MACADDR used to be a positional parameter. Now it is the last parameter but may be omitted as before. So I first check, if there is a mac addr (grep) and if so I take the last parameter (awk).