addMessage('Interface is up', 'success'); $wlan0up = true; } else { $status->addMessage('Interface is down', 'warning'); } if( isset($_POST['ifdown_wlan0']) ) { exec( 'ifconfig wlan0 | grep -i running | wc -l',$test ); if($test[0] == 1) { exec( 'sudo ip link set wlan0 down',$return ); } else { echo 'Interface already down'; } } elseif( isset($_POST['ifup_wlan0']) ) { exec( 'ifconfig wlan0 | grep -i running | wc -l',$test ); if($test[0] == 0) { exec( 'sudo ip link set wlan0 up',$return ); exec( 'sudo ip -s a f label wlan0',$return); } else { echo 'Interface already up'; } } ?>
showMessages(); ?>