From 855562a2c8d7e0ebaf80a541c58757ee492b6d7f Mon Sep 17 00:00:00 2001 From: Cody Cook Date: Wed, 12 Jun 2019 16:01:22 -0700 Subject: [PATCH] Update rr4360psu.sh with fixed usrmsg again... --- etc/frontview/support/rr4360psu.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/etc/frontview/support/rr4360psu.sh b/etc/frontview/support/rr4360psu.sh index 1eddfeb..d1e669b 100755 --- a/etc/frontview/support/rr4360psu.sh +++ b/etc/frontview/support/rr4360psu.sh @@ -11,20 +11,20 @@ debug=0 usrmsg(){ if [[ "$debug" -gt 0 ]]; then - printf "$*" + echo "$*" fi } get_tools() { if test -f "$inb" && test -f "$outb"; then - usrmsg "Tools exist - not acquiring again.\n" + usrmsg "Tools exist - not acquiring again." else - usrmsg "Acquiring latest tools... \n" + usrmsg "Acquiring latest tools... " if ! test -f "$inb"; then - usrmsg "Missing inb; downloading now.\n" + usrmsg "Missing inb; downloading now." wget -q "$get_inb" -O "$inb" fi if ! test -f "$outb"; then - usrmsg "Missing outb; downloading now.\n" + usrmsg "Missing outb; downloading now." wget -q "$get_outb" -O "$outb" fi fi @@ -39,32 +39,32 @@ check_problem() { validate_problem() { if [[ "$problem" -ne 7 ]]; then - usrmsg " SMBus reporting invalid value; reported: %s\n" "$problem" + usrmsg "SMBus reporting invalid value: $problem" fix else - usrmsg " The SMBus is currently operating as normal. Exiting script.\n" + usrmsg "SMBus is currently operating as normal. Exiting script." exit 0 fi } fix() { attempts=$((attempts+1)) - usrmsg " Attempt %s at fixing the SMBus..." "$attempts" + usrmsg -n "Attempt $attempts at fixing the SMBus..." sleep 1 - usrmsg " (#3)... " + usrmsg -n " (#3)... " "$outb" 0xf00f 3 2>/dev/null sleep 1 - usrmsg " (#7)... " + usrmsg -n " (#7)... " "$outb" 0xf00f 7 2>/dev/null sleep 1 - usrmsg " fix applied. \n" + usrmsg " fix applied." verify_fix } verify_fix(){ if [[ "$attempts" -lt 10 ]]; then check_problem else - usrmsg "Attempted to recover this %s times... seek alternative recovery method.\n" "$attempts" + usrmsg "Failed to recover this after $attempts times... seek alternative recovery method." exit 1 fi }