Skip to content

Commit

Permalink
Optimized script
Browse files Browse the repository at this point in the history
  • Loading branch information
Gsonovb committed Jan 3, 2017
1 parent f10c7fc commit 1c15bdb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Add download.ps1 /download.ps1
RUN powershell.exe -ExecutionPolicy RemoteSigned -noninteractive -File /download.ps1

#ADD ${site_root} /inetpub/wwwroot
RUN icacls c:\inetpub\wwwroot\App_data /T /grant IIS_IUSRS:M
RUN icacls c:\inetpub\wwwroot\Media /T /grant IIS_IUSRS:M
#RUN icacls c:\inetpub\wwwroot\App_data /T /grant IIS_IUSRS:M
#RUN icacls c:\inetpub\wwwroot\Media /T /grant IIS_IUSRS:M
#ADD setacl.ps1 /inetpub
#RUN powershell.exe -ExecutionPolicy RemoteSigned -noninteractive -File /inetpub/setacl.ps1

Expand Down
18 changes: 16 additions & 2 deletions download.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ $mdir = Join-Path $expdir $movedir;
Write-Host "Move Files $expdir to $desdir .";
robocopy "$mdir" "$desdir" /E

Write-Host "Delete Files $expdir .";


Write-Host "Granting authority ";
icacls.exe c:\inetpub\wwwroot\App_data /T /grant IIS_IUSRS:M
icacls.exe c:\inetpub\wwwroot\Media /T /grant IIS_IUSRS:M


Write-Host "Delete Temp Files $expdir .";
Remove-Item $expdir -Recurse -Force;
Write-Host "Delete Files $filename .";
Write-Host "Delete Download File $filename .";
Remove-Item $filename -Force;

if($args[0] -ne "debug")
{
Write-Host "Delete script ";
remove-item $MyInvocation.MyCommand.Path -force
}

Write-Host "Done.";

0 comments on commit 1c15bdb

Please sign in to comment.