@ECHO off ::qq:123769752 setlocal enabledelayedexpansion mode con cols=50 lines=17 :test set var=[luohongjiang] set /A ff=100/30 for /l %%i in (1,1,30) do ( set /A ss=%%i*!ff! set var=!var!^> cls set /p var=!var!!ss!%% <nul ping 127.0.0.1 -n 1 >nul ) :init cls for /F "eol=# tokens=1* delims=^=" %%i in (.\cfg.ini) do ( title %%i %%j if %%i EQU updatewyip ( set wyipaddress=%%j PING !wyipaddress! -n 1 -w 300ms >nul IF !ERRORLEVEL! NEQ 0 ( msg %username% /w "軟體網絡設置有問題,請檢查設置." notepad cfg.ini exit ) ) if %%i EQU updatewgip ( set wgipaddress=%%j PING !wgipaddress! -n 1 -w 300ms >nul IF !ERRORLEVEL! NEQ 0 ( msg %username% /w "體軟網絡設置有問題,請檢查設置." notepad cfg.ini exit ) ) if %%i EQU wyversion set wyver=%%j if %%i EQU wgversion set wgver=%%j if %%i EQU wypath set ypath=%%j if %%i EQU wgpath set gpath=%%j if %%i EQU sshclientxml set sshxmlpath=%%j ) set /a mm=%random%%%9 color %mm%f if exist \\!wyipaddress!\!ypath!\*.exe ( msg %username% /w "軟體有新的版本了,請測試後發佈." set alart=軟體有新版本了,請測試後發佈.) else ( set alart=暫時沒有可用版本. ) if exist \\!wgipaddress!\!gpath!\*.exe ( msg %username% /w "體軟有新的版本了,請測試後發佈." set alart=體軟有新版本了,請測試後發佈.) else ( set alart=暫時沒有可用版本. ) :menu title 版本發佈器 cls echo 提示: %alart% echo ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗ echo │ [1] 軟體版本發佈 │ echo │ │ echo │ [2] 融合版本發佈 │ echo │ │ echo │ [3] 軟體試用版本 │ echo │ │ echo │ [4] 體軟試用版本 │ echo │ │ echo │ [5] 添加SSH映射IP和端口 │ echo ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝ echo. echo. echo. set var=0 set /p var=請輸入對應的數字進行相應功能[1/2/3/4/5/z]: if %var% EQU 1 (goto :wyupdate ) if %var% EQU 2 (goto :wgupdate ) if %var% EQU 3 (goto :wydowntest ) if %var% EQU 4 (goto :wgdowntest ) if %var% EQU 5 (goto :modssh ) if %var% EQU z (start notepad %sshxmlpath% && exit ) else (goto :init) ::::::::::::::::::::::::::::::::wyupdate:::::::::::::::::::::::::::::: :wyupdate xcopy /j /d /i .\I-signal_Setup\Setup.exe \\!wyipaddress!\!ypath!\ pause goto :menu ::::::::::::::::::::::::::::::::wgupdate:::::::::::::::::::::::::::::: :wgupdate xcopy /j /d /i .\I-signal_Setup\Setup.exe \\!wyipaddress!\!gpath!\ pause goto :menu ::::::::::::::::::::::::::::::::wydowntest:::::::::::::::::::::::::::::: :wydowntest title !wyipaddress! if exist \\!wyipaddress!\!ypath!\*.exe ( del /q I-signal_Setup mkdir I-signal_Setup xcopy /j /d /i \\!wyipaddress!\!ypath!\*.exe .\I-signal_Setup move .\I-signal_Setup\*.exe .\I-signal_Setup\Setup.exe del /q \\!wyipaddress!\!ypath!\*.exe exit ) else ( set alart=暫時尚未新版本,你就等等吧. goto :menu ) ::::::::::::::::::::::::::::::::wgdowntest:::::::::::::::::::::::::::::: :wgdowntest title !wyipaddress! if exist \\!wyipaddress!\!gpath!\*.exe ( del /q I-signal_Setup mkdir I-signal_Setup xcopy /j /d /i \\!wyipaddress!\!gpath!\*.exe .\I-signal_Setup move .\I-signal_Setup\*.exe .\I-signal_Setup\Setup.exe del /q \\!wyipaddress!\!gpath!\*.exe exit ) else ( set alart=暫時尚未新版本,你就等等吧. goto :menu ) ::::::::::::::::::::::::::::::::modify ssh:::::::::::::::::::::::::::::: :modssh copy %sshxmlpath% %sshxmlpath%.bak cls set ip=%ip% set port=%port% set /p ip=請輸入添加的IP[%ip%]: set /p port=請輸入添加的端口[%port%]: for /F "delims=;" %%i in ( %sshxmlpath% ) do ( echo %%i >>test.xml for %%j in ( %%i ) do ( if %%j == ^<Local^> ( echo ^<TargetAddress ip="%ip%" port="%port%"^> ^</TargetAddress^> >> test.xml echo 添加成功 pause ) ) ) copy test.xml %sshxmlpath% >nul del /q test.xml goto :menu
配置文件服務器
#此文件爲配置文件, 請按下面格式更改.
########################軟體###################
#配置軟體更新服務器的ip 地址
updatewyip=127.0.0.1
#配置軟體下載試用軟件的目錄
wypath=package
#配置軟體上傳軟件的目錄
wyupath=uppackage
#配置軟體發佈軟件的版本號
wyversion=v1.0
########################體軟####################
#配置體軟更新服務器的ip 地址
updatewgip=127.0.0.1
#配置體軟上傳軟件的目錄
wgupath=uppackage
#配置體軟下載試用軟件的目錄
wgpath=package
#配置體軟發佈軟件的版本號
wgversion=v1.0
########################ssh#####################
#配置ssh代理程序配置文件SSHProxyClient.xml的路徑
sshclientxml=.\SSHProxyClient.xml網絡