[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

283.0. "How to find modem lines?" by VEN11::BIGELOW (Dave Bigelow) Wed Aug 06 1986 19:25

    Does any know how to find out which terminal lines have modems 
    connected to them. I am on a new system and would like to find
    out if we have any dialout lines (so that I can use set host/dte
    ...). Can this be done?
    
    Dave
T.RTitleUserPersonal
Name
DateLines
283.1findterm.comTHEBAY::MTHOMASThe Mad HackerThu Aug 07 1986 01:4050
    Here's a hacky command file to find terminals that you can use to
    dial out on.  It checks the protection of the terminal to make sure
    you have access to them.
    
    	$ @findterm
    
    matt

$		say = "write sys$output"
$		devmm = "_TX,_TT"
$		devices = 0
$		!
$ next_devmm:	if  devmm .eqs. ""  then goto end
$		dd = f$extract(0,f$locate(",",devmm),devmm)
$		devmm = f$extract(f$locate(",",devmm)+1,f$length(devmm),devmm)
$		c = "A"		! start off fresh
$		!
$ next_cont:	label = "next_devmm"
$		c[0,8] = f$cvui(0,8,c) + 1
$		u = 0
$		!
$ loop:		terminal = dd + c + f$string(u) + ":"
$		if  .not.  f$getdvi(terminal,"exists")  then goto 'label'
$		if  .not.  f$getdvi(terminal,"tt_modem")  then goto next_unit
$		if  .not.  f$getdvi(terminal,"avl")  then goto next_unit
$		!
$		vprot = f$getdvi(terminal,"vprot")
$		prot = f$extract(f$locate("WORLD=",vprot)+6,4,vprot) - "L" - "P"
$		if  "''prot'" .eqs. ""  then goto next_unit
$		!
$		string = " (unallocated)"
$		if  f$getdvi(terminal,"refcnt") .gt. 0  then -
$		    string =	" (allocated to PID "+-
				f$getdvi(terminal,"pid")+-
				")"
$		say  "Found:	"+terminal+string
$		devices = devices + 1
$		!
$ next_unit:	label = "next_cont"
$		u = u + 1
$		goto loop
$		!
$		!
$ end:		if  devices .eq. 0 then goto none
$		say	f$fao("Total:	!UL terminal!%S found.",devices)
$		exit
$		!
$ none:		say	"No terminals where found."
$		exit
283.2IOSG::WARWICKTrevor WarwickThu Aug 07 1986 08:255
    
    	However, a more effiecient way might be to ask your system
    manager...
    
    Trev
283.3But...VEN11::BIGELOWDave BigelowThu Aug 07 1986 14:143
    But that's TOO easy. 
    
    Thanks Trev ... I'll try your hack straight away.  ... dave