mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-27 20:36:29 -04:00
Verify user-specified SSH identity file exists
This commit is contained in:
+12
-1
@@ -38,7 +38,18 @@ func TempInitCli() {
|
||||
sshUser := input("Remote SSH username:")
|
||||
sshPort := input("Remote SSH port:")
|
||||
sshIP := input("Remote SSH IP/domain:")
|
||||
sshKey := expandPathWithHome(input("SSH private identity file path:"))
|
||||
|
||||
// prompt for and ensure existence of SSH identity file
|
||||
var sshKey string
|
||||
var sshKeyIsFile bool
|
||||
for !sshKeyIsFile {
|
||||
sshKey = expandPathWithHome(input("SSH private identity file path:"))
|
||||
sshKeyIsFile, _ = backend.TargetIsFile(sshKey, false, 0)
|
||||
if !sshKeyIsFile {
|
||||
fmt.Println(backend.AnsiError + "SSH identity file not found: " + sshKey + backend.AnsiReset)
|
||||
}
|
||||
}
|
||||
|
||||
sshKeyProtected := inputBinary("Is the identity file password-protected?")
|
||||
|
||||
// initialize libmutton directories
|
||||
|
||||
Reference in New Issue
Block a user