-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve handling of Tailscale login
- Loading branch information
Showing
3 changed files
with
29 additions
and
41 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/always/webgui-check.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 5 additions & 20 deletions
25
src/usr/local/emhttp/plugins/tailscale/include/tailscale-watcher/restart-services.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,8 @@ | ||
<?php | ||
if ($tailscale_config["INCLUDE_INTERFACE"] == 1) { | ||
logmsg("Restarting Unraid services"); | ||
exec($restart_command); | ||
|
||
logmsg("Restarting Unraid services"); | ||
exec($restart_command); | ||
|
||
// Wait for two minutes, then check to see if nginx is listening on the Unraid address | ||
// If it isn't, this probably means that nginx didn't reload properly and needs to be forced. | ||
if (isset($tailscale_ipv4)) { | ||
sleep(12); | ||
|
||
$ident_config = parse_ini_file("/boot/config/ident.cfg"); | ||
|
||
$connection = @fsockopen($tailscale_ipv4, $ident_config['PORT']); | ||
|
||
if (is_resource($connection)) { | ||
logmsg("WebGUI listening on {$tailscale_ipv4}:{$ident_config['PORT']}"); | ||
} else { | ||
logmsg("WebGUI not listening on {$tailscale_ipv4}:{$ident_config['PORT']}, terminating and restarting"); | ||
exec("/etc/init.d/rc.nginx term"); | ||
sleep(5); | ||
exec("/etc/init.d/rc.nginx start"); | ||
} | ||
// Wait to allow services to restart before continuing | ||
sleep(15); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters