killer.sh
public shellscript v1 · immutable#!/bin/bashUSER=$1PROCS="rtorrent deluged utorrent.exe"NMAX=1PROCLIST=`ps -u $USER`COUNT=0for proc in $PROCS; do NGREP=`echo "$PROCLIST" | grep -c $proc` COUNT=`expr $COUNT + $NGREP`doneif [ $COUNT -gt $NMAX ]; then for proc in $PROCS; do echo "$PROCLIST" | grep $proc | cut -c 1-5 | xargs kill donefi