diff --git a/software/.gitignore b/software/.gitignore index 8d6bdfc..e8ade9f 100644 --- a/software/.gitignore +++ b/software/.gitignore @@ -3,3 +3,5 @@ *.xpi *.zip *.msixbundle +ftpsettings.cmd + diff --git a/software/download-software.cmd b/software/download-software.cmd index 556814a..79906a0 100644 --- a/software/download-software.cmd +++ b/software/download-software.cmd @@ -15,7 +15,7 @@ IF NOT EXIST %LISTFILE% ( exit /b ) -echo using file [ %LISTFILE% ] ... +echo using list [ %LISTFILE% ] ... rem ################################### rem MAIN loop ( download software ) ... diff --git a/software/other.csv b/software/other.csv new file mode 100644 index 0000000..d9724a9 --- /dev/null +++ b/software/other.csv @@ -0,0 +1,2 @@ +dummy purebasic-setup.exe +dummy citrixreceiver-setup.exe diff --git a/software/upload-to-ftp.cmd b/software/upload-to-ftp.cmd new file mode 100644 index 0000000..85e82a5 --- /dev/null +++ b/software/upload-to-ftp.cmd @@ -0,0 +1,76 @@ +@echo off + +rem =================== +rem CONFIGFILE CHECK +rem =================== + +if NOT EXIST ftpsettings.cmd ( + echo. + echo ERROR: ftpsettings.cmd NOT FOUND + echo. + echo --- please create with following content --- + 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 +) + +rem =================== +rem COMMANDLINE CHECKS +rem =================== + +IF %1.==. GOTO USAGE +rem removing extension ... +set LISTFILE=%~n1 +rem adding extension again ... +set LISTFILE=%LISTFILE%.csv + +IF NOT EXIST %LISTFILE% ( + echo ERROR: %LISTFILE% not found! + exit /b +) + +echo. +echo loading settings ... +call ftpsettings.cmd +echo ++++++++++++++++++ +echo FTP_SERVER=%FTP_SERVER% +echo FTP_PATH=%FTP_PATH% +echo FTP_USER=%FTP_USER% +echo FTP_PASS=xxxxxx +echo ++++++++++++++++++ +echo. + +echo using list [ %LISTFILE% ] ... + +rem ################################### +rem MAIN loop ( UPLOAD software ) ... +rem ################################### + +FOR /F "tokens=1,2 delims=, " %%E in (%LISTFILE%) do ( + + rem file present ? + IF EXIST %%F ( + rem UPLOAD with curl ... + echo. + echo upload of: [ %%F ] + curl -u %FTP_USER%:%FTP_PASS% -T %%F ftp://%FTP_SERVER%/%FTP_PATH%/ + ) else ( + echo. + echo WARNING: [ %%F ] does not exist, cannot upload ... + ) + +) + +rem ===== +rem END +rem ===== +GOTO END + +:USAGE +echo "usage: %0 " +echo LISTFILE = basic, browser, optional or other +echo. + +:END