mirror of
https://github.com/ANG13T/SatIntel.git
synced 2026-06-12 19:11:17 -07:00
Check if space track and n2yo creds are present, else prompt the user to enter them
This commit is contained in:
@@ -1,17 +1,43 @@
|
|||||||
/*
|
/*
|
||||||
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
|
Copyright © 2023 Angelina Tsuboi angelinatsuboi@proton.me
|
||||||
|
|
||||||
*/
|
*/
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"github.com/ANG13T/SatIntel/cli"
|
"github.com/ANG13T/SatIntel/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
func set_environmental_variable(env_key string) {
|
||||||
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
fmt.Print(env_key + ": ")
|
||||||
|
input, err := reader.ReadString('\n')
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error reading input:", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
os.Setenv(env_key, strings.TrimSpace(input))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func check_environmental_variable(env_key string) {
|
||||||
|
if os.Getenv(env_key) == "" {
|
||||||
|
set_environmental_variable(env_key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
os.Setenv("SPACE_TRACK_USERNAME", "username")
|
check_environmental_variable("SPACE_TRACK_USERNAME")
|
||||||
os.Setenv("SPACE_TRACK_PASSWORD", "password")
|
check_environmental_variable("SPACE_TRACK_PASSWORD")
|
||||||
os.Setenv("N2YO_API_KEY", "api-key")
|
check_environmental_variable("N2YO_API_KEY")
|
||||||
|
|
||||||
cli.SatIntel()
|
cli.SatIntel()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package osint
|
|||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/iskaa02/qalam/gradient"
|
"github.com/iskaa02/qalam/gradient"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/TwiN/go-color"
|
"github.com/TwiN/go-color"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@@ -31,7 +31,7 @@ func SatellitePositionVisualization() {
|
|||||||
var norad string
|
var norad string
|
||||||
fmt.Scanln(&norad)
|
fmt.Scanln(&norad)
|
||||||
GetLocation(norad)
|
GetLocation(norad)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user