From: Frank Brehm Date: Tue, 11 Jan 2022 09:01:42 +0000 (+0100) Subject: Fixing scripts/functions.rc because of failing call of tty X-Git-Tag: 0.4.1~2 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=c1a7e1d7253a679aabda74eae80e911a21acfcd1;p=pixelpark%2Fpp-admin-tools.git Fixing scripts/functions.rc because of failing call of tty --- 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 - } #------------------------------------------------------------------------------