You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.0 KiB
Batchfile

start /min "Pegasus" "c:\Program Files (x86)\Pegasus Astro\Unity Platform\server\Peg.Server.exe"
timeout 10
curl -X PUT "http://localhost:32000/Server/Start"
timeout 5
curl -s -X GET "http://localhost:32000/Server/DeviceManager/Connected" | jq.exe -r ".data[0].uniqueKey" > id.txt
for /f "delims=" %%x in (id.txt) do set UID=%%x
IF [%UID%] == [null] GOTO NoDevice
curl -X OPTIONS "http://localhost:32000/Driver/PPBAdvance/Start?DriverUniqueKey=%UID%"
curl -X PUT "http://localhost:32000/Driver/PPBAdvance/Power/Hub/On?DriverUniqueKey=%UID%"
curl -X PUT "http://localhost:32000/Driver/PPBAdvance/Power/Variable/On?DriverUniqueKey=%UID%"
curl -X PUT "http://localhost:32000/Driver/PPBAdvance/Dew/1/On?DriverUniqueKey=%UID%"
curl -X PUT "http://localhost:32000/Driver/PPBAdvance/Dew/2/On?DriverUniqueKey=%UID%"
curl -X POST "http://localhost:32000/Driver/PPBAdvance/Dew/Auto/On?DriverUniqueKey=%UID%"
timeout 5
telegraf.exe --config with_ppba.conf
exit /b
:NoDevice
timeout 5
telegraf.exe --config without_ppba.conf
exit /b