w10install/apps/upload-apps-to-ftp.cmd

47 lines
1.1 KiB
Batchfile
Raw Permalink Normal View History

@echo off
2024-02-23 14:06:39 +01:00
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 #####################################
rem folder present ?
IF EXIST %APPSFOLDER% (
rem UPLOAD with curl ...
FOR %%F in (%APPSFOLDER%\*.*) DO (
echo processing ... [ %%F ]
curl -u %FTP_USER%:%FTP_PASS% -T %%F ftp://%FTP_SERVER%/%FTP_PATH%/%APPSFOLDER%/
)
) else (
echo WARNING: [ %APPSFOLDER% ] does not exist, cannot upload ...
)