rusefi/java_console/bin/broadcast.sh

36 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2020-08-14 17:22:17 -07:00
#!/bin/bash
2020-10-02 17:49:34 -07:00
#
# broadcast.sh
# this file is part of rusEFI
#
2020-08-14 17:22:17 -07:00
while true
do
2020-10-07 20:16:47 -07:00
echo Starting network_connector
2020-08-14 17:22:17 -07:00
java -jar console/rusefi_console.jar network_connector
exit_status=$?
echo Exit code: ${exit_status}
2020-08-29 21:59:32 -07:00
# in java code that's UPDATE_SBC_EXIT_CODE magic number
2020-08-15 07:52:48 -07:00
if [ $exit_status -eq 15 ]; then
2020-10-07 16:06:31 -07:00
echo Connector software update to latest was requested
2020-08-15 07:52:48 -07:00
bin/update_bundle.sh
fi
2020-10-07 16:06:31 -07:00
# in java code that's UPDATE_RELEASE_SBC_EXIT_CODE magic number
if [ $exit_status -eq 17 ]; then
2020-10-07 17:26:56 -07:00
echo Connector software update to release was requested
2020-10-07 17:07:10 -07:00
bin/update_bundle_release.sh
2020-10-07 16:06:31 -07:00
fi
2020-08-29 21:59:32 -07:00
# in java code that's UPDATE_FIRMWARE_EXIT_CODE magic number
if [ $exit_status -eq 16 ]; then
2020-08-29 22:23:12 -07:00
echo Firmware update was requested
2020-08-29 21:59:32 -07:00
bin/update_bundle.sh
# todo: we need to start validating that SBC software matches board type, maybe update bundle type based on existing controller?
bin/dfu_switch_and_program.sh
fi
2020-10-07 16:06:31 -07:00
# in java code that's UPDATE_RELEASE_FIRMWARE_EXIT_CODE magic number
if [ $exit_status -eq 18 ]; then
echo Firmware update was requested
2020-10-07 17:07:10 -07:00
bin/update_bundle_release.sh
2020-10-07 16:06:31 -07:00
# todo: we need to start validating that SBC software matches board type, maybe update bundle type based on existing controller?
bin/dfu_switch_and_program.sh
fi
2020-08-14 17:22:17 -07:00
done