2023-01-01 16:43:59 +01:00
|
|
|
@echo off
|
2024-02-23 14:06:39 +01:00
|
|
|
set FTPSETTINGS=..\custom\ftpsettings.cmd
|
2023-01-01 16:43:59 +01:00
|
|
|
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 ...
|
|
|
|
)
|
|
|
|
|