From: Vladimir Sokolovsky Date: Wed, 21 May 2008 13:02:25 +0000 (+0300) Subject: Add '--force' and '--unload-modules' flags to uninstall.sh. X-Git-Tag: vofed-1.3.1~6 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=313da051873c874564ffdd53abe1d9e01cddb18e;p=~emulex%2Fofed_scripts%2F.git Add '--force' and '--unload-modules' flags to uninstall.sh. Signed-off-by: Vladimir Sokolovsky --- diff --git a/uninstall.sh b/uninstall.sh index 4dec47b..3387c42 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -41,6 +41,24 @@ STACK_PREFIX=/usr ARCH=$(uname -m) +UNLOAD_MODULES=0 +FORCE=0 + +while [ $# -gt 0 ] +do + case $1 in + --unload-modules) + UNLOAD_MODULES=1 + ;; + --force) + FORCE=1 + ;; + *) + ;; + esac + shift +done + IB_ALL_PACKAGES="$IB_ALL_PACKAGES kernel-ib kernel-ib-devel ipoibtools " IB_ALL_PACKAGES="$IB_ALL_PACKAGES libopensm libopensm-devel libosmcomp libosmcomp-devel libosmvendor libosmvendor-devel" IB_ALL_PACKAGES="$IB_ALL_PACKAGES openib-diags ib-bonding ib-bonding-debuginfo" @@ -275,8 +293,18 @@ echo echo "This program will uninstall all ${PACKAGE} packages on your machine." echo -read -p "Do you want to continue?[y/N]:" ans_r +if [ $FORCE -eq 0 ]; then + read -p "Do you want to continue?[y/N]:" ans_r +else + ans_r="y" +fi + if [[ "$ans_r" == "y" || "$ans_r" == "Y" || "$ans_r" == "yes" ]]; then + if [ $UNLOAD_MODULES -eq 1 ]; then + if [ -x /etc/init.d/openibd ]; then + ex /etc/init.d/openibd stop + fi + fi [ -x $STACK_PREFIX/sbin/vendor_pre_uninstall.sh ] && ex $STACK_PREFIX/sbin/vendor_pre_uninstall.sh [ -x $STACK_PREFIX/sbin/vendor_post_uninstall.sh ] && \ cp $STACK_PREFIX/sbin/vendor_post_uninstall.sh /tmp/$$-ofed_vendor_post_uninstall.sh