aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands/TincApp.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/TincApp.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt b/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
index e7ad8e5..032b20e 100644
--- a/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
+++ b/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
@@ -1,6 +1,6 @@
1/* 1/*
2 * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon 2 * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon
3 * Copyright (C) 2017-2018 Pacien TRAN-GIRARD 3 * Copyright (C) 2017-2020 Pacien TRAN-GIRARD
4 * 4 *
5 * This program is free software: you can redistribute it and/or modify 5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -34,8 +34,9 @@ object TincApp {
34 private val SCRIPT_SUFFIXES = listOf("-up", "-down", "-created", "-accepted") 34 private val SCRIPT_SUFFIXES = listOf("-up", "-down", "-created", "-accepted")
35 private val STATIC_SCRIPTS = listOf("tinc", "host", "subnet", "invitation").flatMap { s -> SCRIPT_SUFFIXES.map { s + it } } 35 private val STATIC_SCRIPTS = listOf("tinc", "host", "subnet", "invitation").flatMap { s -> SCRIPT_SUFFIXES.map { s + it } }
36 36
37 private fun listScripts(netName: String) = AppPaths.confDir(netName).listFiles { f -> f.name in STATIC_SCRIPTS } + 37 private fun listScripts(netName: String) =
38 AppPaths.hostsDir(netName).listFiles { f -> SCRIPT_SUFFIXES.any { f.name.endsWith(it) } } 38 AppPaths.confDir(netName).listFiles { f -> f.name in STATIC_SCRIPTS }!! +
39 AppPaths.hostsDir(netName).listFiles { f -> SCRIPT_SUFFIXES.any { f.name.endsWith(it) } }!!
39 40
40 fun listPrivateKeys(netName: String) = try { 41 fun listPrivateKeys(netName: String) = try {
41 TincConfiguration.fromTincConfiguration(AppPaths.existing(AppPaths.tincConfFile(netName))).let { 42 TincConfiguration.fromTincConfiguration(AppPaths.existing(AppPaths.tincConfFile(netName))).let {