@echo off
setlocal

set DOMAINS=*.nicovideo.jp *.ce.nicovideo.jp *.smilevideo.jp *.nimg.jp *.dmc.nico

if "%NICOCACHE_JAVA%"=="" (
  set java=java
) else (
  set java=%NICOCACHE_JAVA%
)
cd /d %~dp0

for %%f in (lib\bcprov.jar lib\bcpkix.jar) do (
  if not exist %%f (
    echo %%f is not found.
    echo;
    echo NicoCacheCA.jar require lib\bcprov.jar and lib\bcpkix.jar
    echo Please download Bouncy Castle:
    echo   https://www.bouncycastle.org/latest_releases.html
    pause
    exit 1
  )
)

"%java%" -jar NicoCacheCA.jar %DOMAINS%

pause
