site

source files for beau's website
git clone https://git.beauhilton.com/site.git
Log | Files | Refs

stop (269B)


      1 #!/bin/bash
      2 touch temp.text
      3 lsof -n -i4TCP:$1 | awk '{print $2}' > temp.text
      4 pidToStop=`(sed '2q;d' temp.text)`
      5 > temp.text
      6 if [[ -n $pidToStop ]]
      7 then
      8 kill -9 $pidToStop
      9 echo "Congrates!! $1 is stopped."
     10 else
     11 echo "Sorry nothing running on above port"
     12 fi
     13 rm temp.text