#!/bin/bash

# Check if /data/openpilot/shell/bg.jpg does not exist
if [ ! -f /data/openpilot/shell/bg.jpg ]; then
    # Check if /usr/comma/bg.org does exist
    if [ -f /usr/comma/bg.org ]; then
        sudo mount -o remount,rw /
        # Copy /usr/comma/bg.org to /usr/comma/bg.jpg
        sudo mv -f /usr/comma/bg.org /usr/comma/bg.jpg
        # Remove /usr/comma/bg.org
        # sudo rm /usr/comma/bg.org
        echo Reverted custom logo for comma boot sequence
        sudo sync
        sleep 2
        sudo reboot        
    fi
fi