Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / scripts / lustre_rmmod.sh
1 #!/bin/sh
2 #
3 # remove all lustre modules.  Won't succeed if they're in use, or if you
4 # manually did a 'lctl network up'.
5 ###############################################################################
6
7 SRCDIR=`dirname $0`
8 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
9
10 case `uname -r` in
11 2.4.*) RMMOD="modprobe -r";;
12 *) RMMOD="rmmod";;
13 esac
14
15 lctl modules | awk '{ print $2 }' | xargs $RMMOD >/dev/null 2>&1
16 # do it again, in case we tried to unload the lnd's too early
17 lsmod | grep lnet > /dev/null && lctl modules | awk '{ print $2 }' | xargs $RMMOD
18