How to run a script only once, automatically killing up

#!/bin/sh # kill all process with basename, but the current ps aux | grep ./`basename $0` | grep -v $$ | grep -v grep | awk '{ print $2}' | while read LINE; do kill -9 $LINE done