blob: ff210dc07d535cd0b876221a3038888dc27f4479 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#!/bin/bash
2
Austin Schuhc0ec2a82022-02-24 17:26:29 -08003set -x
4
Austin Schuhab8c0c52020-02-22 13:42:37 -08005if [[ "$(hostname)" == "roboRIO"* ]]; then
Austin Schuhac1b7752021-10-12 22:05:09 -07006 /usr/local/natinst/etc/init.d/systemWebServer stop
7
Austin Schuhc0ec2a82022-02-24 17:26:29 -08008 ROBOT_CODE="/home/admin/bin"
Austin Schuhab8c0c52020-02-22 13:42:37 -08009
Austin Schuhde605f12022-02-23 23:08:19 -080010 # Get the CTRE libraries in the shared library search path
11 for f in $(ls *.so);
12 do
Austin Schuhc0ec2a82022-02-24 17:26:29 -080013 ln -f -s /home/admin/bin/$f /usr/local/frc/third-party/lib/$f
Austin Schuhde605f12022-02-23 23:08:19 -080014 done
15
Austin Schuhab8c0c52020-02-22 13:42:37 -080016 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 Kuszmaul2d8fa2a2020-03-01 13:51:50 -080018elif [[ "$(hostname)" == "pi-"* ]]; then
Austin Schuh66e00052021-10-23 22:00:52 -070019 # We have systemd configured to handle restarting, so just exec.
Austin Schuhc0ec2a82022-02-24 17:26:29 -080020 export PATH="${PATH}:/home/pi/bin"
Austin Schuh5c96bf82021-11-02 21:08:17 -070021 rm -rf /dev/shm/aos
Austin Schuh66e00052021-10-23 22:00:52 -070022 exec starterd
Austin Schuhab8c0c52020-02-22 13:42:37 -080023else
Austin Schuhc0ec2a82022-02-24 17:26:29 -080024 ROBOT_CODE="${HOME}/bin"
Austin Schuhab8c0c52020-02-22 13:42:37 -080025fi
26
Austin Schuh540089c2019-12-29 20:36:16 -080027cd "${ROBOT_CODE}"
28export PATH="${PATH}:${ROBOT_CODE}"
Brian Silverman17bb36d2015-03-29 16:50:06 -040029while true; do
Austin Schuh5c96bf82021-11-02 21:08:17 -070030 rm -rf /dev/shm/aos
31 starterd 2>&1
Brian Silverman17bb36d2015-03-29 16:50:06 -040032done