add nlogin.bas

This commit is contained in:
James Paterni 2024-11-11 23:01:39 -05:00
parent c2427492db
commit 6c93b110f2

25
nlogin.bas Normal file
View file

@ -0,0 +1,25 @@
1 LASTHOST$ = TH_SED$(TH_HOSTNAME$,"\s.*","")
10 FOR I = 1 TO ARGC%-1
LASTHOST$ = TH_SED$(TH_HOSTNAME$,"\s.*","")
IF TH_HASLOGIN(ARGV$(I)) = 0 THEN GOSUB 1000
21 TH_EXEC "rlogin "+ARGV$(I)
IF INSTR(DIR$, "porthack", 0) = -1 THEN GOSUB 2000
REM print ARGV$(I)+"$ ls"
REM TH_EXEC "ls"
REM PRINT ARGV$(I)+"$"
REM PRINT ARGV$(I)+"$ netstat"
REM TH_EXEC "netstat"
REM PRINT ARGV$(I)+"$"
30 NEXT I
END
1000 PRINT "No login on " + ARGV$(I)
IF INSTR(DIR$, "porthack", 0) = -1 THEN GOSUB 2000
TH_EXEC("porthack " + ARGV$(I))
RETURN
2000 PRINT "Porthack not on " + TH_HOSTNAME$ + ". Trying to fetch it from " + LASTHOST$
TH_EXEC("ftp " + LASTHOST$)
TH_EXEC("get porthack.exe")
TH_EXEC("quit")
RETURN