-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Google Cloud Shell support - added Cloud Shell environment boostrap script - added support for Cloud Shell env vars for ASN server external URL autodetection - handled bookmarklet creation on special bind address cases (0.0.0.0 or ::) - bookmarklet URL now displayed in server console at service startup
- Loading branch information
Showing
3 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
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
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
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
read -r -d '' banner <<- END_OF_BANNER | ||
#########################################################################################################" | ||
# Helper script to prepare the GCP environment (install prerequisite packages / install the ASN script) # | ||
# Project homepage: https://github.com/nitefood/asn # | ||
######################################################################################################### | ||
END_OF_BANNER | ||
|
||
green=$'\e[38;5;035m' | ||
blue=$'\e[38;5;038m' | ||
red=$'\e[38;5;203m' | ||
black=$'\e[38;5;016m' | ||
greenbg=$'\e[48;5;035m'${black} | ||
dim=$'\e[2m' | ||
default=$'\e[0m' | ||
|
||
clear | ||
echo -e "${dim}$banner${default}\n" | ||
echo -en "Enter your IPQualityScore API token (or press Enter to skip): " | ||
read -sr IQS_TOKEN | ||
if [ -n "$IQS_TOKEN" ]; then | ||
echo -en "\n- Enabling IPQualityScore lookups..." | ||
sudo mkdir -p /etc/asn | ||
echo "$IQS_TOKEN" | sudo tee /etc/asn/iqs_token &>/dev/null | ||
echo "${green}OK${default}" | ||
else | ||
echo -e "\n- IPQualityScore lookups ${red}DISABLED${default}" | ||
fi | ||
echo -en "- Installing prerequisite packages..." | ||
sudo apt update &>/dev/null | ||
sudo apt -y install curl whois bind9-host mtr-tiny jq ipcalc grepcidr nmap ncat aha &>/dev/null | ||
echo -e "${green}OK${default}" | ||
echo -en "- Installing the asn script..." | ||
sudo install -m 755 asn /usr/bin | ||
echo -e "${green}OK${default}" | ||
echo -e "\n${greenbg} All done ${default}\n" | ||
echo -e "Example usage:\n\tServer mode : ${blue}asn -l${default}\n\tASPath trace: ${blue}asn 1.1.1.1${default}\n\nFor a full feature list visit ${blue}https://github.com/nitefood/asn${default}\n\n" |