testexecmgmt/ucc/Source/UUInterface/config_nistnet_reset.pl
changeset 0 3da2a79470a7
equal deleted inserted replaced
-1:000000000000 0:3da2a79470a7
       
     1 #
       
     2 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 # Description:  
       
    14 #
       
    15 
       
    16 my $LOAD_NISTNET="/home/penuser/3GNetworkEmulator/bin/Load.Nistnet";
       
    17 my $REM_MOD="rmmod nistnet";
       
    18 my $CHECK_MOD="lsmod | grep nistnet";
       
    19 
       
    20 #################################################################################################
       
    21 #
       
    22 # Main()
       
    23 #
       
    24 #################################################################################################
       
    25 
       
    26 # Check if the module is loaded -- and unload it if it is
       
    27 my $result = system( $CHECK_MOD );
       
    28 if( $result != 0 ) {
       
    29 	print( "INFO: Nistnet module is not loaded.\n" );
       
    30 } else {
       
    31 	$result = system( $REM_MOD );
       
    32 	if( $result != 0 ) {
       
    33 		print( "ERROR: Unable to remove the nistnet module.\n" );
       
    34 		exit( -1 );
       
    35     	}
       
    36 }
       
    37 
       
    38 # Now reload the module
       
    39 $result = system( $LOAD_NISTNET );
       
    40 if( $result != 0 ) {
       
    41 	print( "ERROR: Unable to load the nistnet module.\n" );
       
    42 	exit( -1 );
       
    43 }
       
    44  
       
    45 # Success
       
    46 exit( 0 );