summaryrefslogtreecommitdiff
path: root/iptv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'iptv.sh')
-rwxr-xr-xiptv.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/iptv.sh b/iptv.sh
index e702a55..78e1484 100755
--- a/iptv.sh
+++ b/iptv.sh
@@ -5,9 +5,15 @@ set -euo pipefail
CURL_ARGS=(--silent --max-time 6)
# Color definitions
-COLOR_DANGER=$(tput setaf 1)
-COLOR_SUCCESS=$(tput setaf 2)
-COLOR_RESET=$(tput sgr0)
+COLOR_DANGER=''
+COLOR_SUCCESS=''
+COLOR_RESET=''
+
+if [[ -n "${TERM-}" ]] && command -v tput &>/dev/null && tput sgr0 &>/dev/null; then
+ COLOR_DANGER=$(tput setaf 1)
+ COLOR_SUCCESS=$(tput setaf 2)
+ COLOR_RESET=$(tput sgr0)
+fi
show_usage () {
echo "Usage: $0 [COMMAND] [OPTIONS]"