From 0e3a089704531566fe801a6b4426edc1a4c79e8f Mon Sep 17 00:00:00 2001 From: afresh1 Date: Thu, 21 Mar 2024 01:02:29 +0000 Subject: [PATCH] Clear spinner after each cycle Otherwise we can get left with a piece of the spinner if all firmware gets updates and don't print a "kept" value. While here, replace \010 with the ksh supported \b, as suggested by cheloha@ Noticed by deraadt@ --- usr.sbin/fw_update/fw_update.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/fw_update/fw_update.sh b/usr.sbin/fw_update/fw_update.sh index 4be63c8a351..912f86ad9b9 100644 --- a/usr.sbin/fw_update/fw_update.sh +++ b/usr.sbin/fw_update/fw_update.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_update.sh,v 1.55 2023/11/15 02:07:43 afresh1 Exp $ +# $OpenBSD: fw_update.sh,v 1.56 2024/03/21 01:02:29 afresh1 Exp $ # # Copyright (c) 2021,2023 Andrew Hewus Fresh # @@ -100,9 +100,10 @@ spin() { { for p in '/' '-' '\\' '|' '/' '-' '\\' '|'; do - echo -n "$p"'\010' + echo -n "$p"'\b' sleep 0.125 done + echo -n " "'\b' }>/dev/tty } -- 2.20.1