reboot method

Future<void> reboot()

Reboots the Liquid Galaxy system.

Implementation

Future<void> reboot() async {
  final String? pw = await sshConnection.password;
  if (!await sshConnection.isConnected() || pw == null) {
    return;
  }

  for (var i = sshConnection.screenAmount; i >= 1; i--) {
    await sshConnection.sendCommand(
        'sshpass -p $pw ssh -t lg$i "echo $pw | sudo -S reboot"');
  }
}