This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ip_script [2020/08/20 09:21] – seanb | ip_script [2024/10/31 21:36] (current) – hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | This script will discover the WAN IP of each WAN interface in a MultiWAN | + | ====== Determine external |
- | --------------------------------------------------------- | + | \\ |
- | #!/bin/sh | + | This script will discover the WAN IP of all WAN interfaces in a MultiWAN configuration and log them in the file: "/tmp/WAN-IPs" |
- | | + | |
- | WAN2=" | + | |
- | WAN3=" | + | |
- | WAN4=" | + | |
+ | <code -> | ||
+ | #!/bin/sh | ||
+ | WAN=" | ||
+ | WAN2=" | ||
+ | WAN3=" | ||
+ | WAN4=" | ||
- | | + | if [ " |
+ | then | ||
+ | if [ " | ||
then | then | ||
- | if [ " | + | |
- | then | + | else |
- | | + | echo "WAN IP address: DOWN"> |
- | else | + | |
- | echo "WAN IP address: DOWN" > / | + | fi |
- | | + | |
- | fi | + | |
- | | + | if [ " |
+ | then | ||
+ | if [ " | ||
then | then | ||
- | if [ " | + | |
- | then | + | else |
- | | + | echo "WAN2 IP address: DOWN">> |
- | else | + | |
- | echo "WAN2 IP address: DOWN" >> / | + | fi |
- | | + | |
- | fi | + | |
- | | + | if [ " |
+ | then | ||
+ | if [ " | ||
then | then | ||
- | if [ " | + | |
- | then | + | else |
- | | + | echo "WAN3 IP address: DOWN">> |
- | else | + | |
- | echo "WAN3 IP address: DOWN" >> / | + | fi |
- | | + | |
- | fi | + | |
- | | + | if [ " |
+ | then | ||
+ | if [ " | ||
then | then | ||
- | if [ " | + | |
- | then | + | else |
- | | + | echo "WAN4 IP address: DOWN">> |
- | else | + | |
- | echo "WAN4 IP address: DOWN" >> / | + | fi |
- | | + | </ |
- | fi | + | |
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ---- | ||
- | --------------------------------------------------------- |