diff --git a/bin/DNS-Scout/share/setup-api-token.sh b/bin/DNS-Scout/share/setup-api-token.sh new file mode 100755 index 0000000..a0b8710 --- /dev/null +++ b/bin/DNS-Scout/share/setup-api-token.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Detect the shell and choose the appropriate configuration file +shell_config_file="" +if [ "$SHELL" == "/bin/bash" ] || [ "$SHELL" == "/usr/bin/bash" ]; then + shell_config_file="$HOME/.bashrc" +elif [ "$SHELL" == "/bin/zsh" ] || [ "$SHELL" == "/usr/bin/zsh" ]; then + shell_config_file="$HOME/.zshrc" +else + echo "Unsupported shell. Exiting." + exit 1 +fi + +# Check if the API token is already set in the shell configuration file +if grep -q "export IPINFO_API_TOKEN=" $shell_config_file; then + echo "API token already set in $shell_config_file. Exiting." + exit 0 +fi + +# Prompt the user for the API token +read -p "Please enter your IPInfo API token: " api_token + +# Check if the API token was entered +if [ -z "$api_token" ]; then + echo "API token is required. Exiting." + exit 1 +fi + +# Add the API token to the user's shell configuration file +echo "export IPINFO_API_TOKEN=$api_token" >> $shell_config_file + +# Reload the shell configuration file to make the new environment variable available immediately +source $shell_config_file + +# Print a success message +echo "API token successfully saved." diff --git a/bin/build.sh b/bin/build.sh index 6649161..c2c4d45 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,8 +1,7 @@ #!/bin/bash -- uses: actions/setup-go@v2 - with: - go-version: 1.21 - modules-directory: src + +# Make sure to install Go 1.21 before running this script +# or update the path to the Go binary accordingly. # Step 1: Compile the Go code echo "Compiling Go code..." diff --git a/bin/dns-scout b/bin/dns-scout new file mode 100755 index 0000000..25efc30 Binary files /dev/null and b/bin/dns-scout differ