1 Star 0 Fork 29

黄佳艳 / SmartPing

forked from 光宇开源 / SmartPing 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
control.cmd 2.94 KB
一键复制 编辑 原始数据 按行查看 历史
ToryZen 提交于 2017-09-24 16:31 . add version and pack
@echo off
title SmartPing
setlocal
set uac=~uac_permission_tmp_%random%
md "%SystemRoot%\system32\%uac%" 2>nul
if %errorlevel%==0 ( rd "%SystemRoot%\system32\%uac%" >nul 2>nul ) else (
echo set uac = CreateObject^("Shell.Application"^)>"%temp%\%uac%.vbs"
echo uac.ShellExecute "%~s0","","","runas",1 >>"%temp%\%uac%.vbs"
echo WScript.Quit >>"%temp%\%uac%.vbs"
"%temp%\%uac%.vbs" /f
del /f /q "%temp%\%uac%.vbs" & exit )
endlocal
:BG
echo
echo SmartPing
echo
echo
echo Instruction USE
echo build run go get and build
echo run run smartping
echo install install smartping as service (use nssm)
echo start start smartping service
echo stop stop smartping service
echo restart stop and start smartping
echo version show smartping version
echo
echo
%~d0
cd %~dp0
::SET select=
SET /P select="Please Enter Instructions:"
IF "%select%"=="build" (
go get -v ./...
go build -o %~dp0\bin\goping.exe %~dp0\src\ping\goping\goping.go
go build -o %~dp0\bin\smartping.exe %~dp0\src\smartping.go
echo Build Finish..
) ELSE (
IF "%select%"=="run" (
%~dp0/bin/smartping.exe
) ELSE (
IF "%select%"=="install" (
%~dp0\\bin\\nssm.exe install smartping %~dp0\\bin\\smartping.exe
) ELSE (
IF "%select%"=="start" (
net start smartping
) ELSE (
IF "%select%"=="stop" (
net stop smartping
) ELSE (
IF "%select%"=="restart" (
net stop smartping
net start smartping
) ELSE (
IF "%select%"=="uninstall" (
sc delete smartping
) ELSE (
IF "%select%"=="version" (
%~dp0\bin\smartping.exe -v
) ELSE (
echo Param Error Try Again!
pause
GOTO BG
)
)
)
)
)
)
)
)
pause
exit
Go
1
https://gitee.com/jiaYanH/smartping.git
git@gitee.com:jiaYanH/smartping.git
jiaYanH
smartping
SmartPing
master

搜索帮助