Update nginx_proxy_manager_cli.sh

+ Fix minor typo
+ Add color enabled
This commit is contained in:
Erreur32 2024-07-11 12:36:09 +02:00 committed by GitHub
parent a213bfc046
commit 3324b9ce0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -375,24 +375,6 @@ delete_proxy_host() {
fi fi
} }
# Function to list all proxy hosts (simple)
list_proxy_hosts_old() {
echo "List of proxy hosts..."
RESPONSE=$(curl -s -X GET "$BASE_URL/nginx/proxy-hosts" \
-H "Authorization: Bearer $(cat $TOKEN_FILE)")
echo "$RESPONSE" | jq -r '.[] | "\(.id) \(.domain_names | join(", ")) \(.enabled)"' | while read -r id domain enabled; do
if [ "$enabled" = "true" ]; then
status="${COLOR_GREEN}enabled${COLOR_RESET}"
else
# status="${COLOR_RED}disabled${COLOR_RESET}"
status="disabled"
fi
printf " id: ${COLOR_YELLOW}%-4s${COLOR_RESET} ${COLOR_GREEN}%-40s${COLOR_RESET} %b\n" "$id" "$domain" "$status"
done
}
# Function to list all proxy hosts (simple) # Function to list all proxy hosts (simple)
list_proxy_hosts() { list_proxy_hosts() {
echo -e "\n${COLOR_ORANGE} List of proxy hosts (simple)${COLOR_RESET}" echo -e "\n${COLOR_ORANGE} List of proxy hosts (simple)${COLOR_RESET}"