From 2940d607ba8f2882a62f4e6754e9091154403eca Mon Sep 17 00:00:00 2001 From: Zhineng Li Date: Sat, 24 Jan 2026 12:49:56 +0800 Subject: update message indicators and colors --- iptv.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iptv.sh b/iptv.sh index f0b98e6..832f1fb 100755 --- a/iptv.sh +++ b/iptv.sh @@ -4,6 +4,11 @@ set -euo pipefail # cURL configurations applied to all requests CURL_ARGS=(--silent --max-time 6) +# Color definitions +COLOR_DANGER=$(tput setaf 1) +COLOR_SUCCESS=$(tput setaf 2) +COLOR_RESET=$(tput sgr0) + show_usage () { echo "Usage: $0 [COMMAND] [OPTIONS]" echo "" @@ -42,9 +47,9 @@ show_decrypt_authinfo_usage () { echo "Usage: $0 decrypt:authinfo " } -step () { echo -e "\033[32m[-]\033[0m $1"; } +step () { printf '%s==> %s%s\n' "$COLOR_SUCCESS" "$1" "$COLOR_RESET"; } -fatal () { echo -e "\033[31m[!]\033[0m $1" >&2; exit 1; } +fatal () { printf '%s!!! %s%s\n' "$COLOR_DANGER" "$1" "$COLOR_RESET" >&2; exit 1; } ensure_curl_is_installed () { if ! command -v curl &>/dev/null; then -- cgit v1.2.3