aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2017-07-11 16:37:08 +0200
committerPacien TRAN-GIRARD2017-07-11 16:47:33 +0200
commit1afc00f3f26472083d814a99f244dae39a960e34 (patch)
treee9f1a1a78941c0ceb610f907158f1545fb5fb489 /app/src/main
parenta2bfd75dee9b4952771a66c555ba1d920a072ae9 (diff)
downloadtincapp-1afc00f3f26472083d814a99f244dae39a960e34.tar.gz
Fix hosts scripts deletion
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/TincApp.kt2
1 files changed, 1 insertions, 1 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 108b27d..b18a39b 100644
--- a/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
+++ b/app/src/main/java/org/pacien/tincapp/commands/TincApp.kt
@@ -14,7 +14,7 @@ object TincApp {
14 private val STATIC_SCRIPTS = listOf("tinc", "host", "subnet", "invitation").flatMap { s -> SCRIPT_SUFFIXES.map { s + it } } 14 private val STATIC_SCRIPTS = listOf("tinc", "host", "subnet", "invitation").flatMap { s -> SCRIPT_SUFFIXES.map { s + it } }
15 15
16 private fun listScripts(netName: String) = AppPaths.confDir(netName).listFiles { f -> f.name in STATIC_SCRIPTS } + 16 private fun listScripts(netName: String) = AppPaths.confDir(netName).listFiles { f -> f.name in STATIC_SCRIPTS } +
17 AppPaths.hostsDir(netName).listFiles { f -> SCRIPT_SUFFIXES.none { f.name.endsWith(it) } } 17 AppPaths.hostsDir(netName).listFiles { f -> SCRIPT_SUFFIXES.any { f.name.endsWith(it) } }
18 18
19 fun removeScripts(netName: String): CompletableFuture<Void> = runAsyncTask { 19 fun removeScripts(netName: String): CompletableFuture<Void> = runAsyncTask {
20 listScripts(netName).forEach { it.delete() } 20 listScripts(netName).forEach { it.delete() }