fbagnol / class.unifi.php

MIT License
22 stars 5 forks source link

Can you explain to me how to run this on linux? #3

Open FunkyMonk8111 opened 1 year ago

FunkyMonk8111 commented 1 year ago

I am using CentOS 8 and I tried running this using:

php sample.php

When I do this, the bash window just pipes out the contents of the file. Any way to actually run it?

sokai commented 11 months ago

@FunkyMonk8111 How your sample.php file looks like?

This should be a working sample. (I can't test it because I re-flashed my APs with OpenWRT … ;-))

<?php

require './class.unifi.php';

$unifi = new unifiapi('username', 'password', 'https://<ip_of_unifi>:84443');

$login = $unifi->login();

if ($login) {
    $auth = $unifi->authorize_guest('mac adress', 60);
}

KR