mirror of
https://github.com/Erreur32/nginx-proxy-manager-Bash-API.git
synced 2024-12-22 13:32:11 +01:00
Update nginx_proxy_manager_cli.sh
+ Fix minor typo + Add color enabled
This commit is contained in:
parent
a213bfc046
commit
3324b9ce0c
1 changed files with 1 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue