From 9f7414d95fcb298785f8aad62696c286c31d6ad1 Mon Sep 17 00:00:00 2001 From: Casper Date: Wed, 23 Sep 2020 21:53:07 +0200 Subject: [PATCH] remove unnecessary use of `cat` (#1616) --- target/fail2ban-wrapper.sh | 2 +- target/postfix-wrapper.sh | 2 +- target/start-mailserver.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/fail2ban-wrapper.sh b/target/fail2ban-wrapper.sh index 1d591f7b..a786eb2c 100644 --- a/target/fail2ban-wrapper.sh +++ b/target/fail2ban-wrapper.sh @@ -26,7 +26,7 @@ trap "/usr/bin/fail2ban-client reload" SIGHUP sleep 5 # wait until fail2ban is dead (triggered by trap) -while kill -0 "$(cat /var/run/fail2ban/fail2ban.pid)" +while kill -0 "$(< /var/run/fail2ban/fail2ban.pid)" do sleep 5 done diff --git a/target/postfix-wrapper.sh b/target/postfix-wrapper.sh index efad0f6d..981d8f07 100644 --- a/target/postfix-wrapper.sh +++ b/target/postfix-wrapper.sh @@ -26,7 +26,7 @@ service postfix start sleep 5 # wait until postfix is dead (triggered by trap) -while kill -0 "$(cat /var/spool/postfix/pid/master.pid)" +while kill -0 "$(< /var/spool/postfix/pid/master.pid)" do sleep 5 done diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 8e677633..cf0fa2bd 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -351,7 +351,7 @@ function _check_hostname() if ( ! echo "${HOSTNAME}" | grep -E '^(\S+[.]\S+)$' > /dev/null ) then _notify 'err' "Setting hostname/domainname is required" - kill "$(cat /var/run/supervisord.pid)" && return 1 + kill "$(< /var/run/supervisord.pid)" && return 1 else return 0 fi @@ -418,7 +418,7 @@ function _setup_default_vars() if ! echo "export ${var}=\"${DEFAULT_VARS[${var}]}\"" >>/root/.bashrc then _notify 'err' "Unable to set ${var}=${DEFAULT_VARS[${var}]}" - kill -15 "$(cat /var/run/supervisord.pid)" + kill -15 "$(< /var/run/supervisord.pid)" return 1 fi @@ -1302,7 +1302,7 @@ function _setup_postfix_virtual_transport() _notify 'task' 'Setting up Postfix virtual transport' [[ -z ${POSTFIX_DAGENT} ]] && echo "${POSTFIX_DAGENT} not set." && \ - kill -15 "$(cat /var/run/supervisord.pid)" && return 1 + kill -15 "$(< /var/run/supervisord.pid)" && return 1 postconf -e "virtual_transport = ${POSTFIX_DAGENT}" }