added check for existence of tailscale log

This commit is contained in:
Blueprint Coding
2024-09-04 16:51:38 -06:00
parent 3b62a01229
commit 5b5e182156
2 changed files with 2 additions and 2 deletions

View File

@@ -503,6 +503,7 @@ if exist "%log_dir%\gpu_info_output.txt" (
set "gpuInfo=GPU Info not found"
)
if exist "%log_dir%\tailscale_status.txt" (
rem Read the the content of tailscale log into vars
set count=0
for /f "tokens=* delims=" %%i in (%log_dir%\tailscale_status.txt) do (
@@ -511,7 +512,7 @@ for /f "tokens=* delims=" %%i in (%log_dir%\tailscale_status.txt) do (
if !count! equ 2 set hostName=%%i
if !count! equ 3 set dnsName=%%i
)
)
rem Remove trailing period from dnsName if it exists
if "!dnsName:~-1!"=="." set "dnsName=!dnsName:~0,-1!"

View File

@@ -42,7 +42,6 @@ if %errorlevel%==0 (
) else if errorlevel 1 (
echo.
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Fetching Tailscale status...
rem Use the dynamic path based on %~dp0 to write to the logs folder
powershell -command ^
"$json = tailscale status --json | ConvertFrom-Json; " ^