From 7d21ec4e72b49865592da563fc71533efd4e1d84 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Mon, 29 Nov 2021 17:21:49 +0500 Subject: [PATCH] test login --- .gitignore | 23 ----------------------- bml-status-tg-bot.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 bml-status-tg-bot.sh diff --git a/.gitignore b/.gitignore index 9d5dff3..30bd623 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,2 @@ -# ---> Laravel -/vendor/ -node_modules/ -npm-debug.log -yarn-error.log - -# Laravel 4 specific -bootstrap/compiled.php -app/storage/ - -# Laravel 5 & Lumen specific -public/storage -public/hot - -# Laravel 5 & Lumen specific with changed public path -public_html/storage -public_html/hot - -storage/*.key .env -Homestead.yaml -Homestead.json -/.vagrant -.phpunit.result.cache diff --git a/bml-status-tg-bot.sh b/bml-status-tg-bot.sh new file mode 100644 index 0000000..6007f9e --- /dev/null +++ b/bml-status-tg-bot.sh @@ -0,0 +1,28 @@ +#!/bin/bash +source .env +login(){ + LOGIN=$(curl -s -c $COOKIE $BML_URL/login \ + --data-raw username=$BML_USERNAME \ + --data-raw password=${BML_PASSWORD} \ + | jq -r .code) + if [ "$LOGIN" = "0" ] + then + echo Login success + elif [ "$LOGIN" = "20" ] + then + sleep 1.5 + echo Account Locked! + echo Please reset password and login again. + elif [ "$LOGIN" = "2" ] + then + echo Password or Username Incorrect + elif [ "$LOGIN" = "37" ] + then + echo Down for Maintenance + echo Try again later + exit + else + echo Unknown Error + exit + fi +}