entrypoint.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. createDir() {
  3. SHARE_DIR='/root/.wine/dosdevices/unc/samba.infoclinica.lan/smartdelta01'
  4. [ ! -d ${SHARE_DIR}/Files ] && mkdir ${SHARE_DIR}/Files
  5. [ ! -d ${SHARE_DIR}/Files/$1 ] && mkdir ${SHARE_DIR}/Files/$1
  6. }
  7. if [ ! -z ${LOGPATH} ]
  8. then
  9. ln -s ${LOGPATH} /opt/analis/log
  10. fi
  11. echo "Create symlinks for configs"
  12. for i in $(ls -d /configs/*.{conf,ini}); do ln -sf ${i} /opt/analis/;done
  13. echo "create ARCHIVE Dictionaries IN OUT ERR"
  14. for i in ARCHIVE Dictionaries IN OUT ERR; do createDir ${i}; done
  15. echo "Starting AnalisServer.exe $@"
  16. echo "This file used to shedule healthchecks" > /opt/analis/checkfile.status
  17. touch /opt/analis/log/fatal.log
  18. ln -s /opt/analis/log/fatal.log /opt/analis/fatal.log
  19. tail -n0 -f /opt/analis/log/fatal.log | while read fread; do echo "[fatal.log]: ${fread}"; done &
  20. # See Redmine 111631
  21. if [ ! -z ${DEBUG} ] && [ ${DEBUG} == "true" ]
  22. then
  23. touch /opt/analis/debug.log
  24. tail -f /opt/analis/debug.log 2> /dev/null | while read fread; do echo "[debug.log]: ${fread}"; :> /root/.wine/drive_c/services/analis/debug.log; done &
  25. exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/analis/AnalisServer.exe" "/app" "/debug" "debugfile=/opt/analis/debug.log" "$@"
  26. else
  27. exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/analis/AnalisServer.exe" "/app" "$@"
  28. fi