|  | @@ -0,0 +1,34 @@
 | 
	
		
			
				|  |  | +Set-PSDebug -Trace 1
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +if (!$env:logshare) {
 | 
	
		
			
				|  |  | +    write-host "LogShare must be defined"
 | 
	
		
			
				|  |  | +    exit 1
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +if (!$env:filesshare) {
 | 
	
		
			
				|  |  | +    write-host "FilesShare must be defined"
 | 
	
		
			
				|  |  | +    exit 1
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +if (!$env:filespath) {
 | 
	
		
			
				|  |  | +    write-host "FilesPath must be defined"
 | 
	
		
			
				|  |  | +    exit 1
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +if ( test-path("C:\ProgramData\Docker\secrets\shares.username") -And test-path("C:\ProgramData\Docker\secrets\shares.passwd") ){
 | 
	
		
			
				|  |  | +    $sh_username=Get-Content -path "C:\ProgramData\Docker\secrets\shares.username"
 | 
	
		
			
				|  |  | +    $sh_passwd=Get-Content -path "C:\ProgramData\Docker\secrets\shares.passwd"
 | 
	
		
			
				|  |  | +    New-SmbMapping -RemotePath $env:logpath -UserName $sh_username -Password $sh_passwd
 | 
	
		
			
				|  |  | +    New-SmbMapping -RemotePath $env:filesshare -UserName $sh_username -Password $sh_passwd
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +else {
 | 
	
		
			
				|  |  | +    New-SmbMapping -RemotePath $env:logpath
 | 
	
		
			
				|  |  | +    New-SmbMapping -RemotePath $env:filesshare
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +new-item -ItemType SymbolicLink -path C:\Services\Analis -Name Log -value $env:logshare -Force
 | 
	
		
			
				|  |  | +new-item -ItemType SymbolicLink -path $env:filespath -Name Files -value $env:filesshare -Force
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +if ( !test-path("C:\Services\Analis\analis.conf") ){
 | 
	
		
			
				|  |  | +    move-item -path C:\Services\Analis\analis-default.conf -destination C:\Services\Analis\analis.conf
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +C:\Services\Analis\AnalisServer.exe $args
 |