Última atividade 1728438531

doracoin revisou este gist 1728438531. Ir para a revisão

1 file changed, 38 insertions

start-podman.bat(arquivo criado)

@@ -0,0 +1,38 @@
1 + @set podmanWaitTime=30
2 + @set podmanContainerWaitTime=3
3 +
4 + @echo wait %podmanWaitTime% seconds for podman start
5 + @ping 127.0.0.1 -n %podmanWaitTime% >nul
6 +
7 + @echo off
8 + setlocal enabledelayedexpansion
9 +
10 + REM 检查 podman machine 是否已经启动
11 + for /f "tokens=2 delims=: " %%i in ('podman machine info ^| findstr machinestate') do (
12 + set machinestate=%%i
13 + )
14 +
15 + REM 去除 machinestate 变量中的空格
16 + set machinestate=%machinestate: =%
17 +
18 + REM 如果 podman machine 没有启动,则启动它
19 + if "%machinestate%" neq "Running" (
20 + echo Starting podman machine...
21 + podman machine start
22 + REM 等待 podman machine 启动完成
23 + timeout /t 10 /nobreak >nul
24 + ) else (
25 + echo Podman machine is already running.
26 + )
27 +
28 + REM 启动 podman 容器
29 + echo Starting podman containers...
30 + @ping 127.0.0.1 -n %podmanContainerWaitTime% >nul
31 +
32 + podman container start filecodebox
33 +
34 + podman container start uptimekuma
35 +
36 + echo All tasks completed.
37 +
38 + endlocal
Próximo Anterior