mirror of
https://github.com/zoffline/zwift-offline.git
synced 2026-06-12 19:11:33 -07:00
Added ability to pause and unpause zwift-offline
functionality by commenting out the entries in the hosts file
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
<# :
|
||||||
|
|
||||||
|
@ECHO OFF
|
||||||
|
TITLE pause_zoffline
|
||||||
|
|
||||||
|
NET SESSION >nul 2>&1 || ( PowerShell start -verb runas '"%~0"' & EXIT /B )
|
||||||
|
|
||||||
|
powershell /nologo /noprofile "iex (${%~f0} | out-string)"
|
||||||
|
|
||||||
|
TASKKILL /F /IM ZwiftLauncher.exe >nul 2>&1
|
||||||
|
|
||||||
|
ECHO zoffline is paused
|
||||||
|
ECHO.
|
||||||
|
|
||||||
|
PAUSE
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
$hostsPath = "$env:windir\System32\drivers\etc\hosts"
|
||||||
|
$hosts = get-content $hostsPath
|
||||||
|
$hosts | Foreach {if ($_ -match '^\s*([^#].*?\d{1,3}.*?zwift.*)')
|
||||||
|
{"# " + $matches[1]} else {$_}} |
|
||||||
|
Out-File $hostsPath -enc ascii
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<# :
|
||||||
|
|
||||||
|
@ECHO OFF
|
||||||
|
TITLE unpause_zoffline
|
||||||
|
|
||||||
|
NET SESSION >nul 2>&1 || ( PowerShell start -verb runas '"%~0"' & EXIT /B )
|
||||||
|
|
||||||
|
powershell /nologo /noprofile "iex (${%~f0} | out-string)"
|
||||||
|
|
||||||
|
TASKKILL /F /IM ZwiftLauncher.exe >nul 2>&1
|
||||||
|
|
||||||
|
ECHO zoffline is unpaused
|
||||||
|
ECHO.
|
||||||
|
|
||||||
|
PAUSE
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
$hostsPath = "$env:windir\System32\drivers\etc\hosts"
|
||||||
|
$hosts = get-content $hostsPath
|
||||||
|
$hosts = $hosts | Foreach {if ($_ -match '^\s*#\s*(.*?\d{1,3}.*?zwift.*)')
|
||||||
|
{$matches[1]} else {$_}}
|
||||||
|
$hosts | Out-File $hostsPath -enc ascii
|
||||||
Reference in New Issue
Block a user