From 5fa62e6bdfdfba2f73c090a4904842bbbf67ab27 Mon Sep 17 00:00:00 2001 From: Derek Kaser <11674153+dkaser@users.noreply.github.com> Date: Thu, 1 Aug 2024 03:14:09 +0000 Subject: [PATCH] feat: improve handling of Tailscale login --- .../tailscale-watcher/always/webgui-check.php | 5 +-- .../tailscale-watcher/restart-services.php | 25 +++--------- .../plugins/tailscale/tailscale-watcher.php | 40 ++++++++++--------- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/always/webgui-check.php b/src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/always/webgui-check.php index cf4f921..71b313f 100644 --- a/src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/always/webgui-check.php +++ b/src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/always/webgui-check.php @@ -1,8 +1,7 @@ getMessage()); + } + } + } - foreach (glob("{$docroot}/plugins/tailscale/include/tailscale-watcher/*.php") as $file) { + foreach (glob("{$docroot}/plugins/tailscale/include/tailscale-watcher/always/*.php") as $file) { try { require $file; } catch (Exception $e) { logmsg("Caught exception in {$file} : " . $e->getMessage()); } } - } - - foreach (glob("{$docroot}/plugins/tailscale/include/tailscale-watcher/always/*.php") as $file) { - try { - require $file; - } catch (Exception $e) { - logmsg("Caught exception in {$file} : " . $e->getMessage()); - } + } else { + logmsg("Waiting for Tailscale IP"); } }