1
0
mirror of https://github.com/EV21/dynb.git synced 2025-12-26 16:39:32 +01:00

fix: more status file issues

This commit is contained in:
2022-11-02 20:42:32 +01:00
parent a496acbebf
commit a85b2bf911

19
dynb.sh
View File

@@ -470,7 +470,7 @@ function setStatus
function checkStatus function checkStatus
{ {
case $_status in case $_status in
nochg*) *nochg*)
if [[ _errorCounter -gt 1 ]]; then if [[ _errorCounter -gt 1 ]]; then
errorMessage "The update client was spamming unnecessary update requests, something might be wrong with your IP-Check site." errorMessage "The update client was spamming unnecessary update requests, something might be wrong with your IP-Check site."
errorMessage "Fix your config and then delete $_statusFile or restart your docker container" errorMessage "Fix your config and then delete $_statusFile or restart your docker container"
@@ -485,8 +485,8 @@ function checkStatus
fi fi
return 0 return 0
;; ;;
badauth | 401) *badauth* | 401 | *Unauthorized*)
if [[ "$_statusUsername" == "$DYNB_USERNAME" && "$_statusPassword" == "$DYNB_PASSWORD" ]]; then if [[ "$_statusUsername" == "$DYNB_USERNAME" && ("$_statusPassword" == "$DYNB_PASSWORD" || $_statusPassword == "$DYNB_TOKEN") ]]; then
errorMessage "Invalid username password combination." errorMessage "Invalid username password combination."
return 1 return 1
else rm "$_statusFile" else rm "$_statusFile"
@@ -495,8 +495,7 @@ function checkStatus
;; ;;
badagent) badagent)
errorMessage "Client is deactivated by provider." errorMessage "Client is deactivated by provider."
echo "Fix your config and then manually remove $_statusFile to reset the client blockade." echo "Please file an issue at GitHub or try another client :)"
echo "If it still fails file an issue at github or try another client :)"
return 1 return 1
;; ;;
!donator) !donator)
@@ -511,7 +510,7 @@ function checkStatus
echo "If it still fails file an issue at github or try another client :)" echo "If it still fails file an issue at github or try another client :)"
return 1 return 1
;; ;;
911 | 5*) 911 | 5* | *'Too Many Requests'*)
delta=$(($(date +%s) - _eventTime)) delta=$(($(date +%s) - _eventTime))
if [[ $delta -lt 1800 ]] if [[ $delta -lt 1800 ]]
then then
@@ -521,6 +520,14 @@ function checkStatus
fi fi
return 0 return 0
;; ;;
*'Bad Request'*)
if [[ "$_statusUsername" == "$DYNB_USERNAME" && ("$_statusPassword" == "$DYNB_PASSWORD" || $_statusPassword == "$DYNB_TOKEN") ]]; then
errorMessage "Bad Request: Please check your credentials, maybe your token is invalid."
return 1
else rm "$_statusFile"
fi
return 0
;;
*) *)
if [[ _errorCounter -gt 1 ]] if [[ _errorCounter -gt 1 ]]
then then