Ignore:
Timestamp:
2009-04-29T19:18:45+12:00 (15 years ago)
Author:
ak19
Message:

GSIcontrol.bat's configure-admin now finally works, since it uses an intermediate file to write the updated admin user entry into (redirection to files works, piping straight to txt2db introduces spaces at the end of each line which causes username, password and other key recognitions to fail).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/gsicontrol.bat

    r19288 r19290  
    112112echo Configuring admin user password:
    113113for /F %%T in ('getpw') do set encrypted_password=%%T
    114 rem echo %encrypted_password%
     114
     115:: Have to create an intermediate file in the following, because echoing
     116:: lines straight into a pipe adds spaces before the end of each line.
     117:: When piping need to double escape angle brackets with three hat signs,
     118:: but when redirecting to a file, need to escape only once (one hat sign).
    115119if ERRORLEVEL 0 (
    116120    (
    117121    echo [admin]
    118     echo ^^^<enabled^^^>true
    119     echo ^^^<groups^^^>administrator,colbuilder,all-collections-editor
    120     echo ^^^<password^^^>%encrypted_password%
    121     echo ^^^<username^^^>admin
    122     )|txt2db -append "%GSDLHOME%\etc\users.gdb"
     122    echo ^<enabled^>true
     123    echo ^<groups^>administrator,colbuilder,all-collections-editor
     124    echo ^<password^>%encrypted_password%
     125    echo ^<username^>admin
     126    ) > "%GSDLHOME%\etc\users.txt"
     127    type "%GSDLHOME%\etc\users.txt" | txt2db -append "%GSDLHOME%\etc\users.gdb"
     128    del "%GSDLHOME%\etc\users.txt" 
    123129) else (
    124130    echo Did not set password
Note: See TracChangeset for help on using the changeset viewer.