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
|
|
|
|
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-08-29 22:23:12 -07:00
|
|
|
echo Connector software update was requested
|
2020-08-15 07:52:48 -07:00
|
|
|
bin/update_bundle.sh
|
|
|
|
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-08-14 17:22:17 -07:00
|
|
|
done
|