Skip to content

Commit cb913c7

Browse files
authored
Check the connection during installation (#1399)
1 parent 8b9f47b commit cb913c7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

AM-INSTALLER

100644100755
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ _check_dependency() {
2121

2222
_check_dependency
2323

24+
# Function to check online connections (uses github.com by default, as the database and CLI itself are stored/hosted there)
25+
_online_check() {
26+
if ! wget -q --tries=3 --timeout=10 --spider https://github.com; then
27+
printf "\n Installer wouldn't work offline\n\n Please check your internet connection and try again\n\n"
28+
exit 1
29+
fi
30+
}
31+
32+
_online_check
33+
2434
# INSTALL "AM" SYSTEM-WIDE
2535
_install_am() {
2636
CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"

0 commit comments

Comments
 (0)