Skip to content

Commit 9c9d41a

Browse files
committed
Reformat project using tabs for consistency.
Reflow some lines, improve readability. Non-functional change (hopefully). Signed-off-by: Matt DeVillier <[email protected]>
1 parent 465b5e2 commit 9c9d41a

File tree

4 files changed

+2088
-2162
lines changed

4 files changed

+2088
-2162
lines changed

firmware-util.sh

100755100644
Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,42 @@ script_url="https://raw.githubusercontent.com/MrChromebox/scripts/main/"
2121
export LC_ALL=C
2222

2323
#set working dir
24-
if grep -q "Chrom" /etc/lsb-release ; then
25-
# needed for ChromeOS/ChromiumOS v82+
26-
mkdir -p /usr/local/bin
27-
cd /usr/local/bin
24+
if grep -q "Chrom" /etc/lsb-release; then
25+
# needed for ChromeOS/ChromiumOS v82+
26+
mkdir -p /usr/local/bin
27+
cd /usr/local/bin
2828
else
29-
cd /tmp
29+
cd /tmp
3030
fi
3131

3232
# clear screen / show banner
3333
printf "\ec"
3434
echo -e "\nMrChromebox Firmware Utility Script starting up"
35-
3635
#check for cmd line param, expired CrOS certs
3736
if ! curl -sLo /dev/null https://mrchromebox.tech/index.html || [[ "$1" = "-k" ]]; then
38-
export CURL="curl -k"
37+
export CURL="curl -k"
3938
else
40-
export CURL="curl"
39+
export CURL="curl"
4140
fi
4241

4342
if [ ! -d "$script_dir/.git" ]; then
44-
script_dir="."
43+
script_dir="."
4544

46-
#get support scripts
47-
echo -e "\nDownloading supporting files..."
48-
rm -rf firmware.sh >/dev/null 2>&1
49-
rm -rf functions.sh >/dev/null 2>&1
50-
rm -rf sources.sh >/dev/null 2>&1
51-
$CURL -sLO ${script_url}firmware.sh
52-
rc0=$?
53-
$CURL -sLO ${script_url}functions.sh
54-
rc1=$?
55-
$CURL -sLO ${script_url}sources.sh
56-
rc2=$?
57-
if [[ $rc0 -ne 0 || $rc1 -ne 0 || $rc2 -ne 0 ]]; then
58-
echo -e "Error downloading one or more required files; cannot continue"
59-
exit 1
60-
fi
45+
#get support scripts
46+
echo -e "\nDownloading supporting files..."
47+
rm -rf firmware.sh >/dev/null 2>&1
48+
rm -rf functions.sh >/dev/null 2>&1
49+
rm -rf sources.sh >/dev/null 2>&1
50+
$CURL -sLO ${script_url}firmware.sh
51+
rc0=$?
52+
$CURL -sLO ${script_url}functions.sh
53+
rc1=$?
54+
$CURL -sLO ${script_url}sources.sh
55+
rc2=$?
56+
if [[ $rc0 -ne 0 || $rc1 -ne 0 || $rc2 -ne 0 ]]; then
57+
echo -e "Error downloading one or more required files; cannot continue"
58+
exit 1
59+
fi
6160
fi
6261

6362
source $script_dir/sources.sh
@@ -74,25 +73,25 @@ prelim_setup_result="$?"
7473
#saving setup state for troubleshooting
7574
diagnostic_report_save
7675
troubleshooting_msg=(
77-
" * diagnosics report has been saved to /tmp/mrchromebox_diag.txt"
78-
" * go to https://forum.chrultrabook.com/ for help"
76+
" * diagnosics report has been saved to /tmp/mrchromebox_diag.txt"
77+
" * go to https://forum.chrultrabook.com/ for help"
7978
)
8079
if [ "$prelim_setup_result" -ne 0 ]; then
81-
IFS=$'\n'
82-
echo "MrChromebox Firmware Utility setup was unsuccessful" > /dev/stderr
83-
echo "${troubleshooting_msg[*]}" > /dev/stderr
84-
exit 1
80+
IFS=$'\n'
81+
echo "MrChromebox Firmware Utility setup was unsuccessful" >/dev/stderr
82+
echo "${troubleshooting_msg[*]}" >/dev/stderr
83+
exit 1
8584
fi
8685

8786
#show menu
8887

8988
trap 'check_unsupported' EXIT
9089
function check_unsupported() {
91-
if [ "$isUnsupported" = true ]; then
92-
IFS=$'\n'
93-
echo "MrChromebox Firmware Utility didn't recognize your device" > /dev/stderr
94-
echo "${troubleshooting_msg[*]}" > /dev/stderr
95-
fi
90+
if [ "$isUnsupported" = true ]; then
91+
IFS=$'\n'
92+
echo "MrChromebox Firmware Utility didn't recognize your device" >/dev/stderr
93+
echo "${troubleshooting_msg[*]}" >/dev/stderr
94+
fi
9695
}
9796

9897
menu_fwupdate

0 commit comments

Comments
 (0)