Backends: print versions somewhere in log

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-06-02 19:26:33 +02:00
parent 4671f59c67
commit 567503abc7
2 changed files with 4 additions and 2 deletions
@@ -109,8 +109,10 @@ public final class WgQuickBackend implements Backend {
try (final FileOutputStream stream = new FileOutputStream(tempFile, false)) {
stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
}
final String command = String.format("wg-quick %s '%s'",
String command = String.format("wg-quick %s '%s'",
state.toString().toLowerCase(), tempFile.getAbsolutePath());
if (state == State.UP)
command = "cat /sys/module/wireguard/version && " + command;
final int result = rootShell.run(null, command);
// noinspection ResultOfMethodCallIgnored
tempFile.delete();