-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4b3fbb8
Showing
11 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Up | ||
|
||
## The simple terminal package that allows you to check if you can connect to the internet. | ||
|
||
# About | ||
|
||
This is a simple package that just tests the ability to connect to [Example.com](http://example.com). If it doesn't is tells you that your internet is down, if it works it will say it works. | ||
|
||
# Installation | ||
|
||
## Windows | ||
|
||
Installing is very simple, if your using windows, just download the required .exe file and run it from the command prompt. | ||
|
||
Another way to run this script on windows, is an installation of WSL. Follow linux steps if you will install using a WSL Terminal | ||
|
||
## Linux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
package="main.go" | ||
|
||
package_name="up" | ||
|
||
if [[ -z "$package" ]]; then | ||
echo "usage: $0 <package-name>" | ||
exit 1 | ||
fi | ||
|
||
platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/amd64" "linux/386" "linux/arm64" "linux/arm") | ||
|
||
for platform in "${platforms[@]}" | ||
do | ||
platform_split=(${platform//\// }) | ||
|
||
GOOS=${platform_split[0]} | ||
GOARCH=${platform_split[1]} | ||
|
||
output_name=$package_name'-'$GOOS'-'$GOARCH | ||
|
||
output_folder="build/" | ||
|
||
output_total=$output_folder$output_name | ||
|
||
if [ $GOOS = "windows" ]; then | ||
output_name+='.exe' | ||
fi | ||
|
||
echo "Building for ${GOOS} with arch ${GOARCH}" | ||
|
||
env GOOS=$GOOS GOARCH=$GOARCH go build -o $output_total $package | ||
|
||
echo "Completed building ${output_name}" | ||
|
||
done | ||
|
||
echo "All builds complete" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Testing your internet connection") | ||
|
||
resp, err := http.Get("http://example.com") | ||
|
||
_ = resp | ||
|
||
if err != nil { | ||
fmt.Println("Internet is down") | ||
} else { | ||
fmt.Println("Internet is working") | ||
|
||
} | ||
} |