alias cftp { sockopen ftp $$1 $iif($2,$2,21) | .timerWaitForFTP 1 5 echo -s FTP on $$1 is not responding or does not exist }
on *:sockread:ftp:{
var %temp | sockread %temp
if ($gettok(%temp,1,32) == 220) echo -s FTP on $sock($sockname).ip is online and serving
if ($gettok(%temp,1,32) == 120) echo -s FTP on $sock($sockname).ip is online but busy
if ($gettok(%temp,1,32) == 421) echo -s FTP on $sock($sockname).ip is online but not willing to serve
unset %waitForFTP | sockclose ftp | .timerWaitForFTP off
}