03.02.2020, 23:31
Hello,
Can anyone tell me if this sample script can be "transplanted" to LM?
Can anyone tell me if this sample script can be "transplanted" to LM?
Code:
#!/bin/bash
username=user
password=password
baseurl=https://IP:8443
cookie=/tmp/unifi_cookie
curl_cmd="curl --silent --cookie ${cookie} --cookie-jar ${cookie} --insecure "
#login
${curl_cmd} --data "{'username':'$username', 'password':'$password'}" $baseurl/api/login > /dev/null 2>&1
${curl_cmd} $baseurl/api/s/default/stat/sta > /var/www/scripts/unifi-users.json
#logout
${curl_cmd} $baseurl/logout > /dev/null 2>&1