This shows you the differences between two versions of the page.
kurs:kill_user.sh [2014/09/10 21:22] |
kurs:kill_user.sh [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | #/bin/bash | ||
+ | |||
+ | if [ -z $1 ] | ||
+ | then | ||
+ | echo "Bitte geben Sie einen User an" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | thread=`ps -u $1 | awk '{print $1}' | grep -v PID` | ||
+ | |||
+ | #echo $thread | ||
+ | |||
+ | j=0 | ||
+ | |||
+ | for i in ${thread[*]} | ||
+ | do | ||
+ | echo "kill" $i | ||
+ | done | ||
+ | </code> | ||