get-modems.pl
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:1k
- #!/usr/local/bin/perl
- #
- # Returns number of active analog and digital dial-ins
- #
- # This script could be very much improved - it's a quick hack
- # and it works ...
- #
- # I'm doing a "w" sorting out all the important tty's (ttyC for cyclades
- # boards) and checking if the correspond to the digita lines
- #
- # T.Pospisek <tpo@spin.ch> :
- #
- # Distributed under the GNU copyleft
- #
-
- # Number of active tty's
- $isdn = 0;
- $modem = 0;
- # Name of this host
- $my_name = "Dial-In";
- # Our digital lines
- $tty{"ttyC12"}="i";
- $tty{"ttyC13"}="i";
- $tty{"ttyC14"}="i";
- $tty{"ttyC15"}="i";
- $tty{"ttyC16"}="i";
- $tty{"ttyC24"}="i";
- $tty{"ttyC25"}="i";
- open(TTYS, "w -hs|cut -b 10-17|fgrep ttyC|");
- while(<TTYS>) {
- chop;
- s/s+//;
- if( $tty{"$_"} ) {
- $isdn++;
- } else {
- $modem++;
- }
- }
- print "$modemn";
- print "$isdnn";
- print "0n";
- print "$my_namen";