# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # bos720 src/bos/usr/sbin/snappd/scripts/IPSetTokenRing.pl 1.5 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2000,2002 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # #!/usr/bin/perl -T # @(#)02 1.5 src/bos/usr/sbin/snappd/scripts/IPSetTokenRing.pl, snapp, bos720 5/31/02 07:50:35 #-------------------------------------------------------------------- #--------Token Ring Modification Page for Snapp Program ------------- #-------------------------------------------------------------------- #--------This page is the entry point for the XML ------------- #--------Pages used with the Snapp Program ------------- #-------------------------------------------------------------------- #--------Links to Pages: SRPasswd.pl, SetPageSpace.pl, IPMain.pl----- #-------------------------------------------------------------------- $ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin'; #-----get the interface to get the information about. If the interface is #-----not passed in as a command line argument, then get it from the eni file $en = "tr0"; if(@ARGV[0]) { $en = @ARGV[0]; open(OUTFILE,">/var/snapp/snapp.eni"); print OUTFILE "$en"; close (OUTFILE); } else { open(ENFILE, "/var/snapp/snapp.eni"); $en = ; close(ENFILE); } #-------------------------------------------------------------------------- #-------- Get Current Interface Information ------------------- #-------------------------------------------------------------------------- @strInterfaceInfo = split(":",`/usr/sbin/mktcpip -S $en 2>&1 | grep -v "#"`); $strHostname = @strInterfaceInfo[0]; $strIPAddress = @strInterfaceInfo[1]; $strNetmask = @strInterfaceInfo[2]; $strNameServer = @strInterfaceInfo[4]; $strDomain = @strInterfaceInfo[5]; $strGateway = @strInterfaceInfo[6]; $strOSLevel = `/usr/bin/oslevel`; $strOSLevel =~ m/(\d)/g; if( $1 eq 3 || $1 eq 4 ) { $strRingSpeed = @strInterfaceInfo[7]; } elsif( @strInterfaceInfo > 9) { $strRingSpeed = @strInterfaceInfo[9]; } else { $strRingSpeed = "Unknown Value"; } open(OUTFILE,">/var/snapp/snapp.fres.tmp"); print OUTFILE < Set Token Ring Properties ($en) EOXML print OUTFILE <60 12 5 30 12 12 12 12 12 12 12 160 5 90 12 70 30 $strHostname 12 $strIPAddress 12 $strNetmask 12 $strGateway 12 $strDomain 12 $strNameServer 12 $strRingSpeed 60 15 10 130 70 EOXML close(OUTFILE); system("/usr/bin/cp /var/snapp/snapp.fres.tmp /var/snapp/snapp.fres");