mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -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:")
|
sshUser := input("Remote SSH username:")
|
||||||
sshPort := input("Remote SSH port:")
|
sshPort := input("Remote SSH port:")
|
||||||
sshIP := input("Remote SSH IP/domain:")
|
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?")
|
sshKeyProtected := inputBinary("Is the identity file password-protected?")
|
||||||
|
|
||||||
// initialize libmutton directories
|
// initialize libmutton directories
|
||||||
|
|||||||
Reference in New Issue
Block a user