From 8c5359957c3d8a91a423f7edf692eb6e8f90cca9 Mon Sep 17 00:00:00 2001 From: Steven Burnham Date: Fri, 17 Nov 2023 19:03:37 -0500 Subject: [PATCH] removed daemon execution, added new script to execute daemon --- windows_installer.ps1 | 7 +------ windows_reregister.ps1 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 windows_reregister.ps1 diff --git a/windows_installer.ps1 b/windows_installer.ps1 index 42370b4..935a40d 100644 --- a/windows_installer.ps1 +++ b/windows_installer.ps1 @@ -64,9 +64,4 @@ $phoneIpVariable = Set-Variable -Name phoneIp -Value $phoneIp -Scope Global # Execute the `python demo.py` script with the phone IP address passed as a parameter. Write-Output "Registering" -python demo.py --phone $phoneIpVariable - -# Execute the daemon for reregistration -Write-Output "Executing the daemon" -python demo.py --daemon - +python demo.py --phone $phoneIpVariable diff --git a/windows_reregister.ps1 b/windows_reregister.ps1 new file mode 100644 index 0000000..7194278 --- /dev/null +++ b/windows_reregister.ps1 @@ -0,0 +1,12 @@ +cd "$env:USERPROFILE\pypush" + +# Activate the virtual environment +. "$env:USERPROFILE\AppData\Local\Python\VirtualEnvs\pypush\Scripts\activate.ps1" + +# Continuously run the demo script in daemon mode +while ($true) { + python ./demo.py --daemon + + # If the script disconnects, wait 5 minutes before restarting + Start-Sleep -Seconds 300 +} \ No newline at end of file