This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

shell script to LUA
#1
Hello,

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
Reply


Messages In This Thread
shell script to LUA - by edos - 03.02.2020, 23:31
RE: shell script to LUA - by admin - 04.02.2020, 07:48
RE: shell script to LUA - by edos - 04.02.2020, 18:03
RE: shell script to LUA - by admin - 05.02.2020, 07:31
RE: shell script to LUA - by edos - 05.02.2020, 08:53
RE: shell script to LUA - by admin - 05.02.2020, 09:21
RE: shell script to LUA - by edos - 05.02.2020, 11:30
RE: shell script to LUA - by admin - 05.02.2020, 12:11
RE: shell script to LUA - by benanderson_475 - 23.03.2020, 02:03
RE: shell script to LUA - by admin - 23.03.2020, 07:14

Forum Jump: