summaryrefslogtreecommitdiff
path: root/iptv.sh
diff options
context:
space:
mode:
authorZhineng Li <[email protected]>2026-01-24 12:49:56 +0800
committerZhineng Li <[email protected]>2026-01-24 12:49:56 +0800
commit2940d607ba8f2882a62f4e6754e9091154403eca (patch)
tree68dfe5d794b5b60305f121f51daa67bb94c56285 /iptv.sh
parentdc477f5bc2e56400d5aa6250f02c58426c98448e (diff)
downloadchina-unicom-iptv-gd-2940d607ba8f2882a62f4e6754e9091154403eca.tar.gz
china-unicom-iptv-gd-2940d607ba8f2882a62f4e6754e9091154403eca.zip
update message indicators and colors
Diffstat (limited to 'iptv.sh')
-rwxr-xr-xiptv.sh9
1 files 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 <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