in reply to problem in loop break
if (shapcs($MyIP , $MyUser , $MyPass , $MyPass2 , $com +mand1)) { print shapcs($MyIP , $MyUser , $MyPass , $MyPass2 +, $command1) , "\n" ; }
That's really bad (sorry for being harsh). You execute the command twice if successful. Consider saving the return code of shapcs() somewhere and THEN check if it was success and print messages appropriately.
Note that shapcs() can fail in a number of ways which ideally must all be checked and appropriate error codes be returned so that the caller knows exactly what went wrong and not just blame "Authentication Failed" which is only 1 of the error cases.
bw, bliako
|
|---|