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

feat: updated if statement to check positional argument for force kill if not empty

parent 258fcfee
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
......@@ -25,12 +25,12 @@ if [ "$username" = "root" ]; then
exit 1
fi
if [ -k ]; then
if [ -z $2 ]; then
echo "Performing SIGTERM on processes belonging to $username"
pkill -u $userId
elif [ $2 = "-k" ]; then
echo "Performing SIGKILL on processes belonging to $username"
pkill -9 -u $userId
else
echo "Performing SIGTERM on processes belonging to $username"
pkill -u $userId
fi
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