From 3324b9ce0c0ecb1ffb289d733f876765b6cd71dd Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Thu, 11 Jul 2024 12:36:09 +0200 Subject: [PATCH] Update nginx_proxy_manager_cli.sh + Fix minor typo + Add color enabled --- nginx_proxy_manager_cli.sh | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/nginx_proxy_manager_cli.sh b/nginx_proxy_manager_cli.sh index 166b80f..6bd3585 100644 --- a/nginx_proxy_manager_cli.sh +++ b/nginx_proxy_manager_cli.sh @@ -375,24 +375,6 @@ delete_proxy_host() { 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) list_proxy_hosts() { echo -e "\n${COLOR_ORANGE} List of proxy hosts (simple)${COLOR_RESET}" @@ -401,7 +383,7 @@ list_proxy_hosts() { echo "$RESPONSE" | jq -r '.[] | "\(.id) \(.domain_names | join(", ")) \(.enabled)"' | while read -r id domain enabled; do if [ "$enabled" -eq 1 ]; then - status="[${WHITE_ON_GREEN}enabled ${COLOR_RESET}]" + status="[${WHITE_ON_GREEN}enabled${COLOR_RESET}]" else status="[${COLOR_RED}disabled${COLOR_RESET}]" fi