The conditional statement includes a recursive call to the function it is a part of. The idea is that it keeps attempting to change the MAC address until it hits a valid one. Unfortunately the $code variable always come up empty.$code=`ifconfig eth0 hw ether $mac`; print "Returned error: $code \n"; if $code="SIOCSIFHWADDR: Invalid Argument"{&CMac;}
In reply to Ifconfig error capture by WalkingZero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |