move away from sqlite into json file to store keys
This commit is contained in:
parent
e97929cd08
commit
c55203f43f
5 changed files with 258 additions and 249 deletions
12
agent.go
12
agent.go
|
|
@ -79,25 +79,17 @@ func startEphemeralAgent(pemData []byte, target string) (string, func(), error)
|
|||
return sockPath, cleanup, nil
|
||||
}
|
||||
|
||||
func startSSH(dbPath string, args []string) {
|
||||
func startSSH(storePath string, args []string) {
|
||||
user, host := parseDestination(args)
|
||||
env := os.Environ()
|
||||
|
||||
if host != "" {
|
||||
db, err := initDB(dbPath)
|
||||
pemData, err := findKey(storePath, user, host)
|
||||
if err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
pemData, err := findKey(db, user, host)
|
||||
if err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
db.Close()
|
||||
|
||||
targetName := host
|
||||
if user != "" {
|
||||
targetName = user + "@" + host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue