about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Martin <phy1729@gmail.com>2017-07-25 20:45:25 -0500
committerLeаh Neukirchen <chneukirchen@gmail.com>2017-07-26 13:36:59 +0200
commitbd8beaded9f5545f190c8b1570446a6365405408 (patch)
treebc94702face1e13253ea4337f309f62fe4a9a1a2
parent121baec9946541c80028f55894dcd3dd293599c4 (diff)
downloadrunit-void-bd8beaded9f5545f190c8b1570446a6365405408.tar.gz
runit-void-bd8beaded9f5545f190c8b1570446a6365405408.tar.xz
runit-void-bd8beaded9f5545f190c8b1570446a6365405408.zip
shutdown: Do not use variables in printf format string
-rwxr-xr-xshutdown10
1 files changed, 5 insertions, 5 deletions
diff --git a/shutdown b/shutdown
index edb67af..7708479 100755
--- a/shutdown
+++ b/shutdown
@@ -6,7 +6,7 @@ single() {
 }
 
 abort() {
-  echo "$@" >&2
+  printf '%s\n' "$1" >&2
   exit 1
 }
 
@@ -59,15 +59,15 @@ for break in 5 0; do
   [ "$time" -gt "$break" ] || continue
   [ "$break" = 0 ] && touch /etc/nologin
 
-  echo "$message in $time minutes" | wall
-  printf "shutdown: sleeping for $(( time - break )) minutes... "
+  printf '%s in %s minutes\n' "$message" "$time" | wall
+  printf 'shutdown: sleeping for %s minutes... ' "$(( time - break ))"
   sleep $(( (time - break) * 60 ))
   time="$break"
-  printf "\n"
+  printf '\n'
 
   [ "$break" = 0 ] && rm /etc/nologin
 done
 
-echo "$message NOW" | wall
+printf '%s NOW\n' "$message" | wall
 
 $action