# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # bos720 src/bos/usr/sbin/snappd/scripts/IPSetEthernet.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 # @(#)33 1.5 src/bos/usr/sbin/snappd/scripts/IPSetEthernet.pl, snapp, bos720 5/31/02 07:51:07 #--------------------------------------------------------------------- #--------Ethernet Modification Page for Snapp Program -------------- #--------------------------------------------------------------------- #--------This page is gets the information pertinent -------------- #--------For configuring a ethernet interface -------------- #--------------------------------------------------------------------- #--------Links to Pages: IPDoSetEthernet.pl, IPMinConfig.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 th eni file $en = "en0"; 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]; open(OUTFILE,">/var/snapp/snapp.fres.tmp"); print OUTFILE < Set Ethernet Properties ($en) EOXML print OUTFILE <60 12 5 30 12 12 12 12 12 90 12 70 30 $strHostname 12 $strIPAddress 12 $strNetmask 12 $strGateway 12 $strDomain 12 $strNameServer 60 15 10 130 70 EOXML close(OUTFILE); system("/usr/bin/cp /var/snapp/snapp.fres.tmp /var/snapp/snapp.fres");