1#!/bin/sh 2# description: kill owner pid of device 3export LANG="en_US.UTF-8" 4export COLUMNS=256 5LOGFILE="/tmp/lcActiveUSBModem.log" 6 7echo " start to shut down owner of device!!! ====" >> $LOGFILE 8if [ "$1" = "" ]; then 9 echo " parameter error" >> $LOGFILE 10else 11 DEVICE=$1 12fi 13 14BINPID=`/bin/fuser $DEVICE` 15SBINPID=`/sbin/fuser $DEVICE` 16 17if test $BINPID; then 18 echo " kill owner of $DEVICE /bin/fuser $BINPID" >> $LOGFILE 19 `/bin/fuser -k -15 $DEVICE` 20 exit 0 21fi 22 23if test $SBINPID; then 24 echo " kill owner of $DEVICE /sbin/fuser $SBINPID " >> $LOGFILE 25 `/sbin/fuser -k -15 $DEVICE` 26 exit 0 27fi 28 29