Skip to content
Snippets Groups Projects
Commit dd41dc2a authored by Dylan Wheeler's avatar Dylan Wheeler
Browse files

feat: adding secondary pkill statement to do a SIGKILL following the SIGINT....

feat: adding secondary pkill statement to do a SIGKILL following the SIGINT. added checks to prevent script from running on root user
parent a08b470c
No related branches found
No related tags found
1 merge request!159FEAT: adding simple script to kill all of a user's currently running processes
......@@ -3,14 +3,20 @@
username="$1"
usage() {
echo "Usage: $0 USERNAME"
echo "Usage: $0 USERNAME"
}
if [ -z "$username" ]; then
usage
exit1
exit 1
fi
userId=`id -u $1`
if [ "$username" = "root" ]; then
echo "Username cannot be root"
exit 1
fi
pkill -u $userId
pkill -9 -u $userId
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment