]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing scripts/functions.rc because of failing call of tty
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 11 Jan 2022 09:01:42 +0000 (10:01 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 11 Jan 2022 09:01:42 +0000 (10:01 +0100)
scripts/backup-pdns.sh
scripts/functions.rc

index 4ebde04185a45e3498e014f93685c3959c3e8f54..08c24c715588a609f190ffbbd8889580df6029f1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
 
 set -e
 set -u
index 22c47ef36583b48cf936cf858edfafb30af1136a..2238282513cadc6ebbf3781c208fff235b3c3182 100644 (file)
@@ -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
-
 }
 
 #------------------------------------------------------------------------------