entrypoint.ps1 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #Set-PSDebug -Trace 1
  2. if (!$env:serviceshare) {
  3. write-host "ServiceShare must be defined"
  4. exit 1
  5. }
  6. if (!$env:logshare) {
  7. write-host "LogShare must be defined"
  8. exit 1
  9. }
  10. if (!$env:filesshare) {
  11. write-host "FilesShare must be defined"
  12. exit 1
  13. }
  14. if (!$env:filespath) {
  15. write-host "FilesPath must be defined"
  16. exit 1
  17. }
  18. if ( (test-path("C:\ProgramData\Docker\secrets\shares.username")) -And (test-path("C:\ProgramData\Docker\secrets\shares.passwd")) ){
  19. $sh_username=Get-Content -path "C:\ProgramData\Docker\secrets\shares.username"
  20. $sh_passwd=Get-Content -path "C:\ProgramData\Docker\secrets\shares.passwd"
  21. New-SmbMapping -RemotePath $env:serviceshare -UserName $sh_username -Password $sh_passwd
  22. }
  23. else {
  24. New-SmbMapping -RemotePath $env:serviceshare
  25. }
  26. new-item -ItemType SymbolicLink -path C:\Services\Analis -Name Log -value $env:logshare -Force
  27. new-item -ItemType SymbolicLink -path $env:filespath -Name Files -value $env:filesshare -Force
  28. if ( -Not (test-path("C:\Services\Analis\analis.conf")) ){
  29. move-item -path C:\Services\Analis\analis-default.conf -destination C:\Services\Analis\analis.conf
  30. }
  31. echo Get-SmbMapping
  32. Get-SmbMapping
  33. echo ls C:\Services\Analis\Log
  34. ls C:\Services\Analis\Log
  35. echo ls $env:filesshare
  36. ls $env:filesshare
  37. C:\Services\Analis\AnalisServer.exe $args
  38. sleep 1000000