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:22] – 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 |
| - | --------------------------------------------------------- | + | \\ |
| - | | + | This script will discover the WAN IP of all WAN interfaces in a MultiWAN configuration and log them in the file: "/ |
| - | WAN=" | + | |
| - | WAN2=" | + | <code -> |
| - | WAN3=" | + | #!/bin/sh |
| - | WAN4=" | + | WAN=" |
| - | + | WAN2=" | |
| - | + | WAN3=" | |
| - | if [ " | + | WAN4=" |
| + | |||
| + | if [ " | ||
| + | | ||
| + | if [ "$(ifconfig | ||
| 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 | + | |
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | |||
| + | ---- | ||
| - | --------------------------------------------------------- | ||