import 'dart:io';

Future<void> linuxShutdown({bool restart = false, int delay = 0}) {
  final params = <String>[];

  if (restart) {
    params.add('-r');
  }

  params.addAll(<String>['-t', delay.toString(), 'now']);

  return Process.run('sudo', ['shutdown', ...params]);
}
