Check wan_ifname before using it: 

Bug on Unify:  Non-existing eth1 is assigned by OpenWRT