For MS Windows we have opted to preseed a set of passwords so users don't have to type all those passwords. That however involves changing a bunch of config files in the bootstrap directory. Doing that manually for every release was just out of the question. Sed comes to the rescue.
echo offThat is magic. No more messing around and screwing up.
SET SED=C:\bin\sed.exe
SET VER=12.2
SET WORKINGDIR=C:\workplace\gnumed-server.%VER%\server\bootstrap
SET GMDBOPWD=gm-dbpass
SET PGPWD=postgrespassword
cd %WORKINGDIR%
echo # patching files in %WORKINGDIR%
for %%f in (*.conf) do %SED% -i "s/password = /password = %GMDBOPWD%/g" %%f
for %%f in (*.conf) do %SED% -i "s/#password =/password = %PGPWD%/g" %%f
echo # clean up
del sed*
No comments:
Post a Comment