if [[ $LINKUP == YES ]]; then conf t default interface $INTERFACE interface $INTERFACE description *** AP *** switchport trunk allowed vlan 30,40,50 switchport trunk native vlan 60 switchport mode trunk switchport port-security maximum 256 switchport port-security authentication control-direction in authentication event fail action authorize vlan 20 authentication event server dead action authorize vlan 20 authentication event no-response action authorize vlan 20 authentication event server alive action reinitialize authentication order mab authentication port-control auto authentication timer inactivity 1 mab dot1x pae authenticator dot1x timeout auth-period 10 spanning-tree portfast edge exit end fi if [[ $LINKUP == NO ]]; then conf t default interface $INTERFACE interface $INTERFACE description *** AUTH PORT *** switchport access vlan 10 switchport mode access switchport port-security maximum 256 switchport port-security authentication control-direction in authentication event fail action authorize vlan 20 authentication event server dead action authorize vlan 20 authentication event no-response action authorize vlan 20 authentication event server alive action reinitialize authentication order mab authentication port-control auto mab dot1x pae authenticator dot1x timeout auth-period 10 spanning-tree portfast edge exit end fi