Fix spacing and # error

This commit is contained in:
Cody Cook 2019-06-12 15:39:58 -07:00
commit 50de621dd4

View file

@ -12,20 +12,20 @@ debug=0
if [[ "$debug" -gt 0 ]]; then
usrmsg="printf"
else
usrmsg="#"
usrmsg="echo > /dev/null <<"
fi
get_tools() {
if test -f "$inb" && test -f "$outb"; then
$usrmsg "Tools exist - not acquiring again."
$usrmsg "Tools exist - not acquiring again.\n"
else
$usrmsg "Acquiring latest tools... "
$usrmsg "Acquiring latest tools... \n"
if ! test -f "$inb"; then
$usrmsg "Missing inb; downloading now."
$usrmsg "Missing inb; downloading now.\n"
wget -q "$get_inb" -O "$inb"
fi
if ! test -f "$outb"; then
$usrmsg "Missing outb; downloading now."
$usrmsg "Missing outb; downloading now.\n"
wget -q "$get_outb" -O "$outb"
fi
fi
@ -33,17 +33,17 @@ get_tools() {
}
check_problem() {
$usrmsg "Querying the SMBus for its current status..."
$usrmsg "Querying the SMBus for its current status...\n"
problem=$($inb 0xf00f)
validate_problem
}
validate_problem() {
if [[ "$problem" -ne 7 ]]; then
$usrmsg " SMBus reporting invalid value; reported: %s" "$problem"
$usrmsg " SMBus reporting invalid value; reported: %s\n" "$problem"
fix
else
$usrmsg " The SMBus is currently operating as normal. Exiting script."
$usrmsg " The SMBus is currently operating as normal. Exiting script.\n"
exit 0
fi
}
@ -65,7 +65,7 @@ verify_fix(){
if [[ "$attempts" -lt 10 ]]; then
check_problem
else
$usrmsg "Attempted to recover this %s times... seek alternative recovery method." "$attempts"
$usrmsg "Attempted to recover this %s times... seek alternative recovery method.\n" "$attempts"
exit 1
fi
}