From 4c4410c94825d0f9bd01972f9dc2a065b3196a9d Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 14 Mar 2021 21:09:46 +0100 Subject: [PATCH] scripts: posixify / remove bashisms --- tools/restart_network.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/restart_network.sh b/tools/restart_network.sh index 103348d..2ff196b 100644 --- a/tools/restart_network.sh +++ b/tools/restart_network.sh @@ -1,14 +1,14 @@ #!/bin/sh -function warning { - echo "`basename $0`: Warning: ${@:1}" 1>&2; +warning() { + printf "%s: Warning: %s\n" "$(basename $0)" "$*" 1>&2 } -function service_do { - if systemctl $1 $2; then +service_do() { + if systemctl "$1" "$2"; then return 0; else - warning "Status $?" "on $1 $2" ${@:3} + warning "Status $? on" "${@}" return 1; fi }