You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 5 second countdown with option to force stdout output
41
+
force_stdout=false
42
+
echo -e "\n${BOLD}Collecting debug information for Armbian support${NC}"
43
+
echo -e "Press any key within 5 seconds to output to stdout instead of uploading..."
44
+
foriin {5..1};do
45
+
echo -ne "\r$i seconds remaining... "
46
+
# Read with timeout (works in bash)
47
+
ifread -s -n 1 -t 1;then
48
+
force_stdout=true
49
+
echo -e "\n${BOLD}Key pressed - will output to stdout${NC}\n"
50
+
break
51
+
fi
52
+
done
53
+
if [ "$force_stdout"=false ];then
54
+
echo -e "\rStarting upload... "
55
+
fi
56
+
57
+
# Collect and process the info
58
+
if [ "$force_stdout"=true ];then
59
+
# Output to stdout with line numbers
60
+
CollectSupportInfo |
61
+
sed -E 's/([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3})/XXX.XXX.\3\4/g'|
62
+
awk '!NF{$0=" "}1'| nl -
63
+
echo -e "\nPlease upload the ${BOLD}whole output${NC} above to an online pasteboard service\nand provide the URL in the forum where you have been asked for this.\n"
64
+
else
65
+
# Try to upload to paste servers
66
+
upload_success=false
67
+
68
+
forpaste_serverin"${paste_servers[@]}";do
69
+
echo"Collecting info and sending to ${paste_server}..."
echo -e "\n${BOLD}Upload successful!${NC} Please post the URL above in the forum.\n"
97
+
else
98
+
echo -e "\n${BOLD}All upload attempts failed. Outputting to stdout instead:${NC}\n"
99
+
CollectSupportInfo |
100
+
sed -E 's/([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3})/XXX.XXX.\3\4/g'|
101
+
awk '!NF{$0=" "}1'| nl -
102
+
echo -e "\nPlease upload the ${BOLD}whole output${NC} above to an online pasteboard service\nand provide the URL in the forum where you have been asked for this.\n"
# Check PIPESTATUS to know if everything worked. Any non-zero exit status means something didn't work.
184
-
foriin"${PIPESTATUS[@]}";do
185
-
counter=$((counter +1))
186
-
if [[ $i-ne 0 ]];then
187
-
echo"Failed grabbing info (pipe ${counter} result ${i}) and sending to server ${paste_server}."
188
-
continue 2 # continue the outer loop (paste_servers)
189
-
fi
190
-
done
191
-
echo -e "Please post the URL in the forum where you've been asked for.\n"
192
-
exit 0
193
-
done
194
-
195
-
;;
196
-
197
-
U)
198
-
# Send support info to stdout to be uploaded manually. Add line numbers to prevent
199
-
# users being creative and supressing everything that's important
200
-
CollectSupportInfo |
201
-
sed -E 's/([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3}\.)([0-9]{1,3})/XXX.XXX.\3\4/g'|
202
-
awk '!NF{$0=" "}1'| nl -
203
-
echo -e "\nPlease upload the ${BOLD}whole output${NC} above to an online pasteboard service\nand provide the URL in the forum where you have been asked for this.\n"
0 commit comments