Hi,

On Wed, Feb 17, 2021 at 5:38 PM tincanteksup <tincantek...@gmail.com> wrote:

> Hi,
>
> due to not being allowed to have scripts "echo data" to the log file
> under Windows, debugging scripts is next to impossible.
>
> I presume there are no compile time options to enable "echo" under Windows
> ?
>
> Could anybody provide me with a patch to enable "echo" just for the
> purpose of debugging ?
>
> I would like the patch to work for Openvpn 2.5
>
> I understand the risks and I am not distributing OpenVPN binaries.
>
> As justification I make these points:
>
> * Any large distributor of Openvpn binaries could make the change to
> enable "echo" under Windows.
>
> * That distributor could then abuse it as they please.
>
> * I am simply asking for help for the purpose of debugging Open Source
> Software made for the community.


If it's for debugging, why not redirect the output of the scripts? There
are several ways of doing this like:

(i) replace the script by a wrapper

@echo off
rem this wrapper calls the actual up_script_orig.bat
call up_script_orig.bat >up_script.log 2>&1
exit /b

(ii) move the script to a function and call it, redirecting o/p

@echo off
call :do_work >up_script.log 2>&1
exit /b

:do_work
@echo on
@rem the original script follows..
....
....
@rem end of script
@echo off
exit /b

Selva
_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to