#!/bin/sh
# Check if the action is 'ifdown' (interface down)
# Youtube Tutorial: https://bit.ly/aryochannel

if [ "$ACTION" = "ifdown" ]; then
 if [ "$INTERFACE" = "wan_6" ]; then
  logger -t hotplug "Interface $INTERFACE is down. Attempting to restart."
 /sbin/ifup wan
 fi
fi