Last active
March 16, 2023 03:08
-
-
Save andrewriveradev/6fa70a3fb9247c47c6d1f413d3014047 to your computer and use it in GitHub Desktop.
Revisions
-
andrewriveradev revised this gist
Mar 16, 2023 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ #!/bin/bash # Context: # - add killport.sh to path export PATH="$HOME/bin:$PATH" assuming $HOME/bin is where you keep your scripts # - make killport.sh executable chmod +x killport.sh # write the command to kill the process running on the port kill -9 $(lsof -t -i:$1) # write command to notify the user that the process has been killed or not -
andrewriveradev created this gist
Mar 16, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/bash # write the command to kill the process running on the port kill -9 $(lsof -t -i:$1) # write command to notify the user that the process has been killed or not if [ $? -eq 0 ] then echo "Process running on port $port has been killed" else echo "No process running on port $port" fi