From c1a7e1d7253a679aabda74eae80e911a21acfcd1 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 11 Jan 2022 10:01:42 +0100 Subject: [PATCH] Fixing scripts/functions.rc because of failing call of tty --- scripts/backup-pdns.sh | 2 +- scripts/functions.rc | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/scripts/backup-pdns.sh b/scripts/backup-pdns.sh index 4ebde04..08c24c7 100755 --- a/scripts/backup-pdns.sh +++ b/scripts/backup-pdns.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash set -e set -u diff --git a/scripts/functions.rc b/scripts/functions.rc index 22c47ef..2238282 100644 --- a/scripts/functions.rc +++ b/scripts/functions.rc @@ -1,7 +1,5 @@ #!/bin/bash -HAS_TTY='y' - # Defining colors RED="" YELLOW="" @@ -97,7 +95,7 @@ detect_color() { done # console colors: - if [ "${use_color}" = "true" ] ; then + if [[ "${use_color}" = "true" ]] ; then RED="\033[38;5;196m" YELLOW="\033[38;5;226m" GREEN="\033[38;5;46m" @@ -115,17 +113,6 @@ detect_color() { NORMAL="" fi - local my_tty= - my_tty=$(tty) - if [[ "${my_tty}" =~ 'not a tty' ]] ; then - my_tty='-' - fi - - if [[ "${my_tty}" = '-' || "${safe_term}" = "dump" ]] ; then - # shellcheck disable=SC2034 - HAS_TTY='n' - fi - } #------------------------------------------------------------------------------ -- 2.39.5