@@ -21,43 +21,42 @@ script_url="https://raw.githubusercontent.com/MrChromebox/scripts/main/"
21
21
export LC_ALL=C
22
22
23
23
# 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
28
28
else
29
- cd /tmp
29
+ cd /tmp
30
30
fi
31
31
32
32
# clear screen / show banner
33
33
printf " \ec"
34
34
echo -e " \nMrChromebox Firmware Utility Script starting up"
35
-
36
35
# check for cmd line param, expired CrOS certs
37
36
if ! curl -sLo /dev/null https://mrchromebox.tech/index.html || [[ " $1 " = " -k" ]]; then
38
- export CURL=" curl -k"
37
+ export CURL=" curl -k"
39
38
else
40
- export CURL=" curl"
39
+ export CURL=" curl"
41
40
fi
42
41
43
42
if [ ! -d " $script_dir /.git" ]; then
44
- script_dir=" ."
43
+ script_dir=" ."
45
44
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
61
60
fi
62
61
63
62
source $script_dir /sources.sh
@@ -74,25 +73,25 @@ prelim_setup_result="$?"
74
73
# saving setup state for troubleshooting
75
74
diagnostic_report_save
76
75
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"
79
78
)
80
79
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
85
84
fi
86
85
87
86
# show menu
88
87
89
88
trap ' check_unsupported' EXIT
90
89
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
96
95
}
97
96
98
97
menu_fwupdate
0 commit comments