blob: dc71cbd1bc1c6c608f20b0663f0f4dbd62a8e03f [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 Schuhf23a05a2022-02-24 18:11:23 -08009 cd "${ROBOT_CODE}"
Austin Schuhde605f12022-02-23 23:08:19 -080010
Austin Schuhab8c0c52020-02-22 13:42:37 -080011 ln -s /var/local/natinst/log/FRC_UserProgram.log /tmp/FRC_UserProgram.log
12 ln -s /var/local/natinst/log/FRC_UserProgram.log "${ROBOT_CODE}/FRC_UserProgram.log"
Austin Schuh8aba48c2024-03-16 15:17:51 -070013elif [[ "$(hostname)" == "pi-"* ]]; then
Austin Schuh66e00052021-10-23 22:00:52 -070014 # We have systemd configured to handle restarting, so just exec.
Austin Schuhc0ec2a82022-02-24 17:26:29 -080015 export PATH="${PATH}:/home/pi/bin"
Austin Schuh09ec0072023-02-21 14:17:02 -080016 exec starterd --user=pi --purge_shm_base
Austin Schuh8aba48c2024-03-16 15:17:51 -070017elif [[ "$(hostname)" == "orin-"* ]]; then
18 # We have systemd configured to handle restarting, so just exec.
19 export PATH="${PATH}:/home/pi/bin"
20
21 # Turn the fans up.
22 echo 255 > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1
23
24 exec starterd --user=pi --purge_shm_base
Austin Schuhab8c0c52020-02-22 13:42:37 -080025else
Austin Schuhc0ec2a82022-02-24 17:26:29 -080026 ROBOT_CODE="${HOME}/bin"
Austin Schuhab8c0c52020-02-22 13:42:37 -080027fi
28
Austin Schuh540089c2019-12-29 20:36:16 -080029cd "${ROBOT_CODE}"
30export PATH="${PATH}:${ROBOT_CODE}"
Brian Silverman17bb36d2015-03-29 16:50:06 -040031while true; do
Austin Schuh09ec0072023-02-21 14:17:02 -080032 starterd --purge_shm_base 2>&1
Brian Silverman17bb36d2015-03-29 16:50:06 -040033done