Guest User

Untitled

a guest
Dec 31st, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. :while
  2.  
  3. if "%1"=="-d" ( set WORKDIR=%2 & shift & shift & goto :while )
  4. if "%1"=="--work-dir" ( set WORKDIR="%2" & shift & shift & goto :while )
  5. if "%1"=="-l"( set LOGDIR="%2" & shift & shift & goto :while)
  6. if "%1"=="-log-dir"( set LOGDIR="%2" & shift & shift & goto :while)
  7. if "%1"=="-dh"( set DBHOST="%2" & shift & shift & goto :while)
  8. if "%1"=="--host"( set DBHOST=%2 & shift & shift & goto :while)
  9. if "%1"=="-db"( set DATABASE=%2 & shift & shift & goto :while)
  10. if "%1"=="--database"( set DATABASE=%2 & shift & shift & goto :while)
  11. if "%1"=="-u"( set DBUSER=%2 & shift & shift & goto :while)
  12. if "%1"=="--db-user"( set DBUSER=%2 & shift & shift & goto :while)
  13. if "%1"=="-p"( set DBPASSWORD=%2 & shift & shift & goto :while)
  14. if "%1"=="--db-password"( set DBPASSWORD=%2 & shift & shift & goto :while)
  15. if "%1"=="-j"( set JOBS=%2 & shift & shift & goto :while)
  16. if "%1"=="--jobs"( set JOBS=%2 & shift & shift & goto :while)
  17. if "%1"=="-ld"( set LOGDROP=%2 & shift & shift & goto :while)
  18. if "%1"=="--log-drop"( set LOGDROP=%2 & shift & shift & goto :while)
  19. if "%1"=="-pt"( set PROJECTSTYPE=%2 & shift & shift & goto :while)
  20. if "%1"=="--projects-type"( set PROJECTSTYPE=%2 & shift & shift & goto :while)
  21. if "%1"=="-pn"( set PROJECTNAME=%2 & shift & shift & goto :while)
  22. if "%1"=="--projects-name"( set PROJECTNAME=%2 & shift & shift & goto :while)
  23. if "%1"=="-jc"( set JOBSBATCH=%2 & shift & shift & goto :while)
  24. if "%1"=="--jobs-batch"( set JOBSBATCH=%2 & shift & shift & goto :while)
  25. if "%1"=="-def"( set DEFAULT=YES & shift & goto :while)
  26. if "%1"=="-default"( set DEFAULT=YES & shift & goto :while)
  27. if "%1"==""(set /a POSITIONAL+=%1 & shift & goto :endwhile)
  28.  
  29. :endwhile
  30.  
  31. wmic csproduct get "UUID">mac.txt
  32.  
  33. echo %UUID%
  34.  
  35. SET /P UUID=<mac.txt
  36.  
  37. set file = mac.txt
  38.  
  39. set old = "UUID"
  40.  
  41. more +1 "mac.txt" >"file.txt.new"
  42. move /y "file.txt.new" "mac.txt" >nul
  43.  
  44. SET /P UUID=<mac.txt
  45.  
  46.  
  47.  
  48. rem For /F "usebackq tokens=* skip=1 delims=" %%i In (%file%) Do Set UUID=%%i
  49. echo %UUID%
  50. pause
  51.  
  52. :uniqLoop
  53. set "WORKDIR=bat~%RANDOM%.tmp"
  54. if exist "%WORKDIR%" goto :uniqLoop
  55. echo >"%WORKDIR%"
  56.  
  57. :: Запись переменной в файл для проверки
  58. echo %perem%
  59.  
  60. set LOGDIR="./Logs"
  61. set LOGDROP=NO
  62.  
  63. set DBHOST=localhost
  64. set DATABASE=DAE
  65. set DBUSER=root
  66. set DBPASSWORD=1
  67.  
  68. set JOBS=0.8
  69.  
  70. set PROJECTSTYPE=*
  71. set PROJECTNAME=*
  72.  
  73. set JOBSRECHECK=5
  74. set JOBSBATCH=100
  75.  
  76. set DEFAULT=NO
  77.  
  78. for %%a in (%CD%) do set /a cnt+=1
  79. REM echo %cnt%
  80.  
  81. rem ## worker_start.sh -d tmp - l
  82.  
  83. set f_sr="-d"
  84.  
  85. set POSITIONAL=()
  86. :while
  87.  
  88. pause
  89.  
  90. echo %1
  91. echo %2
  92.  
  93. pause
  94.  
  95. if "%1"=="-d" ( set WORKDIR=%2 & shift & shift & goto :while )
  96. if "%1"=="--work-dir" ( set WORKDIR="%2" & shift & shift & goto :while )
  97. if "%1"=="-l"( set LOGDIR="%2" & shift & shift & goto :while)
  98. if "%1"=="-log-dir"( set LOGDIR="%2" & shift & shift & goto :while)
  99. if "%1"=="-dh"( set DBHOST="%2" & shift & shift & goto :while)
  100. if "%1"=="--host"( set DBHOST=%2 & shift & shift & goto :while)
  101. if "%1"=="-db"( set DATABASE=%2 & shift & shift & goto :while)
  102. if "%1"=="--database"( set DATABASE=%2 & shift & shift & goto :while)
  103. if "%1"=="-u"( set DBUSER=%2 & shift & shift & goto :while)
  104. if "%1"=="--db-user"( set DBUSER=%2 & shift & shift & goto :while)
  105. if "%1"=="-p"( set DBPASSWORD=%2 & shift & shift & goto :while)
  106. if "%1"=="--db-password"( set DBPASSWORD=%2 & shift & shift & goto :while)
  107. if "%1"=="-j"( set JOBS=%2 & shift & shift & goto :while)
  108. if "%1"=="--jobs"( set JOBS=%2 & shift & shift & goto :while)
  109. if "%1"=="-ld"( set LOGDROP=%2 & shift & shift & goto :while)
  110. if "%1"=="--log-drop"( set LOGDROP=%2 & shift & shift & goto :while)
  111. if "%1"=="-pt"( set PROJECTSTYPE=%2 & shift & shift & goto :while)
  112. if "%1"=="--projects-type"( set PROJECTSTYPE=%2 & shift & shift & goto :while)
  113. if "%1"=="-pn"( set PROJECTNAME=%2 & shift & shift & goto :while)
  114. if "%1"=="--projects-name"( set PROJECTNAME=%2 & shift & shift & goto :while)
  115. if "%1"=="-jc"( set JOBSBATCH=%2 & shift & shift & goto :while)
  116. if "%1"=="--jobs-batch"( set JOBSBATCH=%2 & shift & shift & goto :while)
  117. if "%1"=="-def"( set DEFAULT=YES & shift & goto :while)
  118. if "%1"=="-default"( set DEFAULT=YES & shift & goto :while)
  119. if "%1"==""(set /a POSITIONAL+=%1 & shift & goto :endwhile)
  120.  
  121. :endwhile
  122.  
  123. echo "Hello, while is over"
  124. echo "Worker start with options:"
  125.  
  126. echo %UUID%
  127. echo %WORKDIR%
  128. echo %LOGDIR%
  129. echo %LOGDROP%
  130. echo %DBHOST%
  131. echo %DATABASE%
  132. echo %DBUSER%
  133. echo %DBPASSWORD%
  134. echo %JOBS%
  135. echo %PROJECTSTYPE%
  136. echo %PROJECTNAME%
  137. echo %JOBSRECHECK%
  138. echo %JOBSBATCH%
  139. echo %DEFAULT%
  140. echo %POSITIONAL%
  141.  
  142. python worker_start.py --work-dir %WORKDIR% --log-dir %LOGDIR% -dh %DBHOST% -db %DATABASE% -u %DBUSER% -p %DBPASSWORD% -j %JOBS% -ld %LOGDROP% -pt %PROJECTSTYPE% -pn %PROJECTNAME% -jc %JOBSRECHECK% -jb %JOBSBATCH% -def %DEFAULT% --UUID %UUID%
  143. pause
Add Comment
Please, Sign In to add comment