shutdown method

Future<void> shutdown()

Shuts down the Liquid Galaxy system.

Implementation

Future<void> shutdown() 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 poweroff"');
  }
}