Add core modules (SSH args parser, cache, resolver, NetBox client) with tests
Release / release (push) Failing after 51s
Release / release (push) Failing after 51s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package ssh
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// Exec replaces the current process with the native ssh client via syscall.Exec.
|
||||
// All existing SSH configs, keys, and agent forwarding remain intact.
|
||||
func Exec(args []string) error {
|
||||
sshPath, err := exec.LookPath("ssh")
|
||||
if err != nil {
|
||||
return fmt.Errorf("ssh not found in PATH: %w", err)
|
||||
}
|
||||
argv := append([]string{"ssh"}, args...)
|
||||
return syscall.Exec(sshPath, argv, os.Environ())
|
||||
}
|
||||
Reference in New Issue
Block a user