Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- include('../header.php');
- //This file will enable compliance test on ubiquiti radios, tested up to firmware 5.6.9.
- //Variables
- $username = 'username';
- $password = 'password';
- //Enter your IP's here
- $ipsraw =
- '172.16.8.21
- 172.16.0.197';
- //Turns the raw IPs in an array
- $iparray = explode(PHP_EOL,$ipsraw);
- //Loop through each IP in the iparray and change to DHCP Mode
- foreach ($iparray as $ip) {
- echo "$ip ";
- //Login to Device - this uses a proprietary PHP class. You may need to build your own to do SSH.
- $sshObj = new LeadISP\SshCmd($username,$password,$ip);
- //Enters the command to enable Compliance Test: Creates a blank file called "ct"
- echo $sshObj->cmd('touch /etc/persistent/ct')['text'];
- //Saves the changes
- echo $sshObj->cmd('cfgmtd -wp /etc')['text'];
- echo "<br>";
- //End Looping through IP's
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement