Merge pull request #1 from mikeflynn/master

Jack-Tester Utility Payload
pull/3/head
Darren Kitchen 2019-08-27 11:29:02 -07:00 committed by GitHub
commit b28c7e6c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
#!/bin/bash
#
# Title: Jack Tester
# Author: Mike Flynn // Hydrox
# Version: 1.0
#
# Boots and looks for an ip address to test if the port is active on the LAN.
#
# Magenta Solid............Setup
# Red Slow Blink...........Inactive Jack
# Green....................Active Jack
#
function find_subnet() {
SUBNET=$(ip addr | grep -i eth0 | grep -i inet | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}[\/]{1}[0-9]{1,2}" | sed 's/\.[0-9]*\//\.0\//')
}
function run() {
LED SETUP
# Find IP address and subnet
for i in {1..30}; do
sleep 1 && find_subnet
if [ ! -z "$SUBNET" ]; then
break;
fi
done
if [ -z "$SUBNET" ]; then
LED FAIL
else
LED FINISH
fi
}
# Run payload
run &