brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 3 | set -x |
| 4 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 5 | if [[ "$(hostname)" == "roboRIO"* ]]; then |
Austin Schuh | ac1b775 | 2021-10-12 22:05:09 -0700 | [diff] [blame] | 6 | /usr/local/natinst/etc/init.d/systemWebServer stop |
| 7 | |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 8 | ROBOT_CODE="/home/admin/bin" |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 9 | |
Austin Schuh | de605f1 | 2022-02-23 23:08:19 -0800 | [diff] [blame] | 10 | # Get the CTRE libraries in the shared library search path |
| 11 | for f in $(ls *.so); |
| 12 | do |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 13 | ln -f -s /home/admin/bin/$f /usr/local/frc/third-party/lib/$f |
Austin Schuh | de605f1 | 2022-02-23 23:08:19 -0800 | [diff] [blame] | 14 | done |
| 15 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 16 | ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log |
| 17 | ln -s /var/local/natinst/log/FRC_UserProgram.log "${ROBOT_CODE}/FRC_UserProgram.log" |
James Kuszmaul | 2d8fa2a | 2020-03-01 13:51:50 -0800 | [diff] [blame] | 18 | elif [[ "$(hostname)" == "pi-"* ]]; then |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 19 | # We have systemd configured to handle restarting, so just exec. |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 20 | export PATH="${PATH}:/home/pi/bin" |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 21 | rm -rf /dev/shm/aos |
Austin Schuh | 66e0005 | 2021-10-23 22:00:52 -0700 | [diff] [blame] | 22 | exec starterd |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 23 | else |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 24 | ROBOT_CODE="${HOME}/bin" |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 25 | fi |
| 26 | |
Austin Schuh | 540089c | 2019-12-29 20:36:16 -0800 | [diff] [blame] | 27 | cd "${ROBOT_CODE}" |
| 28 | export PATH="${PATH}:${ROBOT_CODE}" |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 29 | while true; do |
Austin Schuh | 5c96bf8 | 2021-11-02 21:08:17 -0700 | [diff] [blame] | 30 | rm -rf /dev/shm/aos |
| 31 | starterd 2>&1 |
Brian Silverman | 17bb36d | 2015-03-29 16:50:06 -0400 | [diff] [blame] | 32 | done |