Skip to content
Snippets Groups Projects
Verified Commit e250e8a5 authored by David Beniamine's avatar David Beniamine
Browse files

Kill running netcats

parent f8c85afc
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
$netcat="netcat -l $IP 9999"
PID=`ps aux | grep "$netcat" | awk '{print $2}'`
[ ! -w "$PID" ] && kill $PID
IP=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1)
subnet=$(ip a | awk '/inet.*containers/ {print $2}' | cut -d / -f 1 | cut -d . -f 1-3)
echo "$1" | netcat $subnet.52 9999
retip=`netcat -l $IP 9999`
echo $retip
$netcat
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment