×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Troubleshooting

rmdev on a busy device by MoshiachNow
Posted: 5 Jan 03 (Edited 9 Feb 04)

#!/bin/ksh
###########################################################################################
#        Updated Jan 21, 2004
#                       Version 1.1                                 
#        A simple script that removes any entX interface,after stopping all network protocols and removing the relevant enX
###########################################################################################

#Get the required entX name from the input
if  [[ $1 != ent? ]] ;then
    echo ôUsage: rment.sh <entX> ô
exit 1
fi

ENT=$1                    #This is required ent
EN=`echo $1 |cut ûc 4`            #This is required en number

#Check that entX exists, exit if not
lsdev ûCs pci |grep ent|awk '{ print $1 }'|grep $1
if  [[ $? != 0 ]] ;then
    echo ô$1 does not exist !ö
    exit 1
fi

while true
do
echo ôIf the $ENT is your default interface - PLEASE DO NOT RUN THIS SCRIPT FROM TELNET !\nTHIS OPERATION WILL CUTT OFF ANY IP CONNECTIONS !\nö
echo "Do you really want to remove the $ENT (the script will exit if you choose No) (y/n) [Y]:\c"
read answer
if [[  $answer = [Yy] ]] || [[ -z $answer ]]  ;then
echo ôremoving the en$EN  and et$EN . . .ö
chdev -l en$EN -a state='down'   
chdev -l et$EN -a state='down'  
rmdev -dl en$EN
rmdev -dl et$EN
echo ôremoving the $1 . . .ö
rmdev -dl $1
if [[ $? = 0 ]] ;then
echo ô$ENT was successfully removed.\nTo recover - run cfgmgr ,define TCPIP ,FULL/HALF DUPLEX .\nIf the $ENT is your default interface û reboot the systemö
exit 0
else
            echo ô$ENT removal has failed !ö
            exit 1
fi
elif [[ $answer = [Nn] ]] ;then
        exit
else
        echo  "\n Please answer y/n only !\n"
    fi
done

Back to IBM: AIX FAQ Index
Back to IBM: AIX Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close