This commit is contained in:
Your Name
2024-02-12 23:34:32 -06:00
parent e034f72f3d
commit e10db32b69

View File

@@ -1,5 +1,36 @@
#!/usr/bin/bash #!/usr/bin/bash
cd /data/openpilot
# Initialize a counter for the timeout
timeout=5
# Loop until we have a network connection or the timeout expires
while ! ping -c 1 google.com &> /dev/null; do
echo "Waiting for internet connection..."
sleep 1
timeout=$((timeout - 1))
if [ "$timeout" -le 0 ]; then
echo "Timeout reached. Proceeding without network operations."
break
fi
done
if [ "$timeout" -gt 0 ]; then
echo "Internet connection established, proceeding with update."
# Fetch the latest changes from the remote repository
git fetch origin
# Reset the local changes and set the local branch to match the remote repository, overwriting local changes
git reset --hard origin/oscrpilot
fi
# Blank the UI (assuming framebuffer device is /dev/fb0)
# This command clears the framebuffer, effectively blanking the screen
dd if=/dev/zero of=/dev/fb0 &> /dev/null
export PASSIVE="0" export PASSIVE="0"
exec ./launch_chffrplus.sh exec ./launch_chffrplus.sh