From 26c34c711e6e6dc2ae7332b95de5b8b31a8bb36b 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 }