forked from DmytroKorniienko/FireLamp_EmbUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Upload_FTP_565_or_322 (put file on).bat
78 lines (63 loc) · 2.12 KB
/
Upload_FTP_565_or_322 (put file on).bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@echo off
@chcp 1251>nul
set workdir=%~dp0
if not exist %workdir%\LAMP_user.cfg (
if exist %workdir%\LAMP_user.cfg.default (
copy %workdir%\LAMP_user.cfg.default %workdir%\LAMP_user.cfg
"C:\Windows\System32\notepad.exe" %workdir%\LAMP_user.cfg
)
)
rem Read values from cfg file
For /F "eol=# tokens=1* delims==" %%i In (%workdir%\LAMP_user.cfg) Do Set %%i=%%j
rem Check filename extention
If "%~1"=="" Goto :M1
For %%a In (565 332) Do If ".%%a"=="%~x1" Goto :M2
echo Wrong file
pause>Nul
Exit
:M2
if exist "%workdir%\ftpscript.txt" (del %workdir%\ftpscript.txt)
echo open %LAMP_IP: =% >> %workdir%\ftpscript.txt
echo %FTP_USER: =% >> %workdir%\ftpscript.txt
echo %FTP_PASSWORD: =% >> %workdir%\ftpscript.txt
echo binary >> %workdir%\ftpscript.txt
echo cd animations >> %workdir%\ftpscript.txt
echo put %1 >> %workdir%\ftpscript.txt
echo quit >> %workdir%\ftpscript.txt
ftp -s:%workdir%\ftpscript.txt
del %workdir%\ftpscript.txt
pause
exit
:M0
Echo #------------------------------------------#-----------------------------------------#
Echo * Get list of animations files 1 * Îòðèìàòè ñïèñîê ôàéë³â àí³ìàö³¿ *
Echo * Delete file (by filename) 2 * Âèäàëèòè ôàéë (çà ³ì'ÿì) *
Echo * Exit 3 * Âèéòè *
Echo #------------------------------------------#-----------------------------------------#
Echo.
Echo.
Set /p choice="Your choice (Âàø âèá³ð): "
if "%choice%"=="1" goto :M1
if "%choice%"=="2" (
Set /p filename="Filename to delete (¯ì'ÿ ôàéëà äëÿ âèäàëåííÿ): "
goto :M1
)
if "%choice%"=="3" exit
:M1
if exist "%workdir%\ftpscript.txt" (del %workdir%\ftpscript.txt)
cls
echo open %LAMP_IP: =% >> %workdir%\ftpscript.txt
echo %FTP_USER: =% >> %workdir%\ftpscript.txt
echo %FTP_PASSWORD: =% >> %workdir%\ftpscript.txt
rem echo binary >> %workdir%\ftpscript.txt
echo cd animations >> %workdir%\ftpscript.txt
if "%choice%"=="2" (
echo delete %filename% >> %workdir%\ftpscript.txt
)
echo dir >> %workdir%\ftpscript.txt
echo quit >> %workdir%\ftpscript.txt
ftp -s:%workdir%\ftpscript.txt
del %workdir%\ftpscript.txt
goto :M0
pause
Exit