w10install/apps/download-apps-from-ftp.cmd
Michael H.G. Schmidt 6f49c025f1 bugfix
2024-02-23 14:06:39 +01:00

47 lines
1.1 KiB
Batchfile

@echo off
set FTPSETTINGS=..\custom\ftpsettings.cmd
set APPSFOLDER=storeapps
rem ===================
rem CONFIGFILE CHECK
rem ===================
if NOT EXIST %FTPSETTINGS% (
echo.
echo ERROR: %FTPSETTINGS% NOT FOUND
echo.
echo --- please create it as follows ---
echo set FTP_SERVER=example.com
echo set FTP_PATH=/path/to/directory
echo set FTP_USER=myuser
echo set FTP_PASS=mypass
exit /b
)
echo.
echo loading settings ...
call %FTPSETTINGS%
echo ++++++++++++++++++
echo FTP_SERVER=%FTP_SERVER%
echo FTP_PATH=%FTP_PATH%
echo FTP_USER=%FTP_USER%
echo FTP_PASS=xxxxxx
echo ++++++++++++++++++
echo.
rem #####################################
rem MAIN loop ( UPLOAD apps to ftp ) ...
rem #####################################
mkdir %APPSFOLDER% 2>nul
IF EXIST %APPSFOLDER% (
rem get all apps with wGET ...
cd %APPSFOLDER%
wget -nv -c -nd -N --user=%FTP_USER% --password=%FTP_PASS% ^
ftp://%FTP_SERVER%/%FTP_PATH%/%APPSFOLDER%/*.*
) else (
echo WARNING: [ %APPSFOLDER% ] does not exist, cannot download ...
)
cd ..