diff options
Diffstat (limited to 'templates/usr_local_bin_restore_jail_aliases.sh.j2')
| -rw-r--r-- | templates/usr_local_bin_restore_jail_aliases.sh.j2 | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/templates/usr_local_bin_restore_jail_aliases.sh.j2 b/templates/usr_local_bin_restore_jail_aliases.sh.j2 deleted file mode 100644 index 25d317f..0000000 --- a/templates/usr_local_bin_restore_jail_aliases.sh.j2 +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# The point of this script is to restore jail aliases -# if the lan0 interface flaps - -if_lan="lan0" -ipv4_out="$(ifconfig lan0 | grep "inet " | grep -v "0xffffffff")" -ipv4_lan="$(echo "${ipv4_out}" | awk '{ print $2 }')" -ipv4_mask="$(echo "${ipv4_out}" | awk '{ print $4 }')" - -if ! [ "$ipv4_mask" = "0xffff0000" ]; then - >&2 echo "Unexpected netmask on lan0: ${ipv4_mask}" - exit 1 -fi - -jls ip4.addr | while read ip; do - case "$ip" in - "192.168"*) ;; - *) continue ;; - esac - if ifconfig "$if_lan" | grep -q "$ip"; then - continue - fi - - echo "Re-adding $ip to $if_lan" - ifconfig "$if_lan" inet "$ip/32" alias -done |
