blob: 7a25fc76fabe38e50759cfa5817a0763d81fee6f [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#!/bin/bash
2
Austin Schuhab8c0c52020-02-22 13:42:37 -08003if [[ "$(hostname)" == "roboRIO"* ]]; then
Austin Schuhac1b7752021-10-12 22:05:09 -07004 /usr/local/natinst/etc/init.d/systemWebServer stop
5
Austin Schuhab8c0c52020-02-22 13:42:37 -08006 ROBOT_CODE="/home/admin/robot_code"
7
8 ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log
9 ln -s /var/local/natinst/log/FRC_UserProgram.log "${ROBOT_CODE}/FRC_UserProgram.log"
James Kuszmaul2d8fa2a2020-03-01 13:51:50 -080010elif [[ "$(hostname)" == "pi-"* ]]; then
Austin Schuh66e00052021-10-23 22:00:52 -070011 # We have systemd configured to handle restarting, so just exec.
12 export PATH="${PATH}:/home/pi/robot_code"
Austin Schuh5c96bf82021-11-02 21:08:17 -070013 rm -rf /dev/shm/aos
Austin Schuh66e00052021-10-23 22:00:52 -070014 exec starterd
Austin Schuhab8c0c52020-02-22 13:42:37 -080015else
16 ROBOT_CODE="${HOME}/robot_code"
17fi
18
Austin Schuh540089c2019-12-29 20:36:16 -080019cd "${ROBOT_CODE}"
20export PATH="${PATH}:${ROBOT_CODE}"
Brian Silverman17bb36d2015-03-29 16:50:06 -040021while true; do
Austin Schuh5c96bf82021-11-02 21:08:17 -070022 rm -rf /dev/shm/aos
23 starterd 2>&1
Brian Silverman17bb36d2015-03-29 16:50:06 -040024done