diff options
| author | Zhineng Li <[email protected]> | 2026-01-24 12:49:56 +0800 |
|---|---|---|
| committer | Zhineng Li <[email protected]> | 2026-01-24 12:49:56 +0800 |
| commit | 2940d607ba8f2882a62f4e6754e9091154403eca (patch) | |
| tree | 68dfe5d794b5b60305f121f51daa67bb94c56285 | |
| parent | dc477f5bc2e56400d5aa6250f02c58426c98448e (diff) | |
| download | china-unicom-iptv-gd-2940d607ba8f2882a62f4e6754e9091154403eca.tar.gz china-unicom-iptv-gd-2940d607ba8f2882a62f4e6754e9091154403eca.zip | |
update message indicators and colors
| -rwxr-xr-x | iptv.sh | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 <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 |
