From 2c49804bd0f3461a39019637d579048eb05d43d8 Mon Sep 17 00:00:00 2001 From: William Elwood Date: Tue, 12 Nov 2019 16:10:57 +0000 Subject: [PATCH] Renormalize line-endings Git has been nagging me about these files that I haven't touched being changed. The solution was to run `git add --renormalize .`. Apparently this needs to be done after setting up `.gitattributes`. According to `git ls-files --eol windows/`, the .bat files were previously stored in the index with CRLF endings and will now be stored with LF endings (with .gitattributes dictating that checked out copies will use CRLF). --- windows/service-install.bat | 70 +++++++++++++++++------------------ windows/service-restart.bat | 70 +++++++++++++++++------------------ windows/service-uninstall.bat | 70 +++++++++++++++++------------------ 3 files changed, 105 insertions(+), 105 deletions(-) diff --git a/windows/service-install.bat b/windows/service-install.bat index 7a1164ca..9a604d97 100755 --- a/windows/service-install.bat +++ b/windows/service-install.bat @@ -1,35 +1,35 @@ -@set @_cmd=1 /* -@echo off -setlocal EnableExtensions -title DNSCrypt-Proxy - -whoami /groups | findstr "S-1-16-12288" >nul && goto :admin -if "%~1"=="RunAsAdmin" goto :error - -echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . -cscript /nologo /e:javascript "%~f0" || goto :error -exit /b - -:error -echo. -echo Error: Administrator privileges elevation failed, -echo please manually run this script as administrator. -echo. -goto :end - -:admin -pushd "%~dp0" -dnscrypt-proxy.exe -service install -dnscrypt-proxy.exe -service start -popd -echo. -echo Thank you for using DNSCrypt-Proxy! - -:end -set /p =Press [Enter] to exit . . . -exit /b */ - -// JScript, restart batch script as administrator -var objShell = WScript.CreateObject('Shell.Application'); -var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); -objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1); +@set @_cmd=1 /* +@echo off +setlocal EnableExtensions +title DNSCrypt-Proxy + +whoami /groups | findstr "S-1-16-12288" >nul && goto :admin +if "%~1"=="RunAsAdmin" goto :error + +echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . +cscript /nologo /e:javascript "%~f0" || goto :error +exit /b + +:error +echo. +echo Error: Administrator privileges elevation failed, +echo please manually run this script as administrator. +echo. +goto :end + +:admin +pushd "%~dp0" +dnscrypt-proxy.exe -service install +dnscrypt-proxy.exe -service start +popd +echo. +echo Thank you for using DNSCrypt-Proxy! + +:end +set /p =Press [Enter] to exit . . . +exit /b */ + +// JScript, restart batch script as administrator +var objShell = WScript.CreateObject('Shell.Application'); +var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); +objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1); diff --git a/windows/service-restart.bat b/windows/service-restart.bat index 4d7f598a..25eb1de2 100755 --- a/windows/service-restart.bat +++ b/windows/service-restart.bat @@ -1,35 +1,35 @@ -@set @_cmd=1 /* -@echo off -setlocal EnableExtensions -title DNSCrypt-Proxy - -whoami /groups | findstr "S-1-16-12288" >nul && goto :admin -if "%~1"=="RunAsAdmin" goto :error - -echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . -cscript /nologo /e:javascript "%~f0" || goto :error -exit /b - -:error -echo. -echo Error: Administrator privileges elevation failed, -echo please manually run this script as administrator. -echo. -goto :end - -:admin -pushd "%~dp0" -dnscrypt-proxy.exe -service stop -dnscrypt-proxy.exe -service start -popd -echo. -echo Thank you for using DNSCrypt-Proxy! - -:end -set /p =Press [Enter] to exit . . . -exit /b */ - -// JScript, restart batch script as administrator -var objShell = WScript.CreateObject('Shell.Application'); -var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); -objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1); +@set @_cmd=1 /* +@echo off +setlocal EnableExtensions +title DNSCrypt-Proxy + +whoami /groups | findstr "S-1-16-12288" >nul && goto :admin +if "%~1"=="RunAsAdmin" goto :error + +echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . +cscript /nologo /e:javascript "%~f0" || goto :error +exit /b + +:error +echo. +echo Error: Administrator privileges elevation failed, +echo please manually run this script as administrator. +echo. +goto :end + +:admin +pushd "%~dp0" +dnscrypt-proxy.exe -service stop +dnscrypt-proxy.exe -service start +popd +echo. +echo Thank you for using DNSCrypt-Proxy! + +:end +set /p =Press [Enter] to exit . . . +exit /b */ + +// JScript, restart batch script as administrator +var objShell = WScript.CreateObject('Shell.Application'); +var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); +objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1); diff --git a/windows/service-uninstall.bat b/windows/service-uninstall.bat index 6580862f..35a1d838 100755 --- a/windows/service-uninstall.bat +++ b/windows/service-uninstall.bat @@ -1,35 +1,35 @@ -@set @_cmd=1 /* -@echo off -setlocal EnableExtensions -title DNSCrypt-Proxy - -whoami /groups | findstr "S-1-16-12288" >nul && goto :admin -if "%~1"=="RunAsAdmin" goto :error - -echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . -cscript /nologo /e:javascript "%~f0" || goto :error -exit /b - -:error -echo. -echo Error: Administrator privileges elevation failed, -echo please manually run this script as administrator. -echo. -goto :end - -:admin -pushd "%~dp0" -dnscrypt-proxy.exe -service stop -dnscrypt-proxy.exe -service uninstall -popd -echo. -echo Thank you for using DNSCrypt-Proxy! - -:end -set /p =Press [Enter] to exit . . . -exit /b */ - -// JScript, restart batch script as administrator -var objShell = WScript.CreateObject('Shell.Application'); -var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); -objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1); +@set @_cmd=1 /* +@echo off +setlocal EnableExtensions +title DNSCrypt-Proxy + +whoami /groups | findstr "S-1-16-12288" >nul && goto :admin +if "%~1"=="RunAsAdmin" goto :error + +echo Requesting privileges elevation for managing the dnscrypt-proxy service . . . +cscript /nologo /e:javascript "%~f0" || goto :error +exit /b + +:error +echo. +echo Error: Administrator privileges elevation failed, +echo please manually run this script as administrator. +echo. +goto :end + +:admin +pushd "%~dp0" +dnscrypt-proxy.exe -service stop +dnscrypt-proxy.exe -service uninstall +popd +echo. +echo Thank you for using DNSCrypt-Proxy! + +:end +set /p =Press [Enter] to exit . . . +exit /b */ + +// JScript, restart batch script as administrator +var objShell = WScript.CreateObject('Shell.Application'); +var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%'); +objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1);