This repository has been archived on 2019-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
2018-05-31 17:07:51 +02:00

24 lines
499 B
Bash
Executable File

#!/bin/bash
#TODO check if at least one device is UP when running "ip addr" in the <> brackets
if [[ -n "$BLOCK_INSTANCE" ]]; then
IF="$BLOCK_INSTANCE"
else
IF=$(ip route | awk '/^default/ { print $5 ; exit }')
fi
if [[ "$IF" == "" || ! -d "/sys/class/net/$IF" ]]; then
echo "off"
echo "X"
echo ""
exit 33
fi
WAN_IP=$(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
LAN_IP=$(ip addr show "$IF")
#TODO show connection
echo "$IP"
echo "$IP"
echo ""