run method
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand
.
Implementation
@override
FutureOr<int>? run() async {
logger.spaces();
final (ip, username) = interaction.getDeviceInfoInteractively(
customDevicesConfig,
'To test an SSH connection to the remote device, we need an IP address and a username',
);
final sshConnectionCreated = await sshService.testPasswordLessSshConnection(
username,
ip,
);
if (sshConnectionCreated) {
logger.success('SSH connection to the remote device is working!');
return 0;
} else {
logger.fail('SSH connection to the remote device is not working!');
return 1;
}
}