mirror of
https://github.com/Telecominfraproject/wlan-cloud-userportal.git
synced 2025-10-29 09:42:25 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -20,14 +20,18 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${OWSEC}" == "" ]] && [[ "${OWSUB}" == "" ]]
|
||||
if [[ -z "${OWSEC}" || -z "${OWSEC_USERNAME}" || -z "${OWSEC_PASSWORD}" ]]
|
||||
then
|
||||
echo "You must set the variable OWSEC OR OWSUB in order to use this script. Something like"
|
||||
echo "OWSEC=security.isp.com:16001"
|
||||
echo "OWSUB=subscription.isp.com:16006"
|
||||
exit 1
|
||||
echo "You must set the variables OWSEC, OWSEC_USERNAME, and OWSEC_PASSWORD in order to use this script. Something like"
|
||||
echo "export OWSEC=security.isp.com:16001"
|
||||
echo "export OWSEC_USERNAME=theusername@domain.com"
|
||||
echo "export OWSEC_PASSWORD=mytoughpassword"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
username=${OWSEC_USERNAME}
|
||||
password=${OWSEC_PASSWORD}
|
||||
|
||||
if [[ "${FLAGS}" == "" ]]
|
||||
then
|
||||
FLAGS="-s"
|
||||
@@ -39,17 +43,6 @@ result_file=result.json
|
||||
browser_list=(firefox sensible-browser xdg-open w3m links links2 lynx youtube-dl)
|
||||
browser=""
|
||||
|
||||
if [ -z ${OWSEC_USERNAME+x} ]; then
|
||||
username="script.runner@arilia.com"
|
||||
else
|
||||
username=${OWSEC_USERNAME}
|
||||
fi
|
||||
if [ -z ${OWSEC_PASSWORD+x} ]; then
|
||||
password="Snoopy99!!!"
|
||||
else
|
||||
password=${OWSEC_PASSWORD}
|
||||
fi
|
||||
|
||||
login() {
|
||||
payload="{ \"userId\" : \"$username\" , \"password\" : \"$password\" }"
|
||||
curl ${FLAGS} -X POST -H "Content-Type: application/json" -d "$payload" "https://${OWSEC}/api/v1/oauth2" > ${result_file}
|
||||
|
||||
Reference in New Issue
Block a user