From 163a3a0fb0eb279b773f9e4f7ab7da1ed0f64f22 Mon Sep 17 00:00:00 2001 From: RomanNum3ral Date: Sun, 3 Aug 2025 17:39:49 +0000 Subject: [PATCH] Update 00-pi_firmware_install.sh --- 00-pi_firmware_install.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/00-pi_firmware_install.sh b/00-pi_firmware_install.sh index d1380d5..aa0c814 100644 --- a/00-pi_firmware_install.sh +++ b/00-pi_firmware_install.sh @@ -2,6 +2,7 @@ # Get the current user CURRENT_USER=$(whoami) +INSTALL_DIR="/home/$CURRENT_USER/jellyfin_raspberry_pi/x735-v2.5" # Update system and install dependencies sudo apt-get update && sudo apt-get upgrade -y @@ -9,9 +10,11 @@ sudo apt install -y python3 sudo apt install -y pigpio python3-pigpio git #sudo apt install -y python-pigpio -# Clone the repository -git clone https://gitea.fortis-scientia.com/RomanNum3ral/x735-v2.5 -cd x735-v2.5 +# Clone the repository (if it doesn't already exist) +if [ ! -d "$INSTALL_DIR" ]; then + git clone https://gitea.fortis-scientia.com/RomanNum3ral/x735-v2.5 "$INSTALL_DIR" +fi +cd "$INSTALL_DIR" || exit 1 # Make all shell scripts executable sudo chmod +x *.sh @@ -20,8 +23,8 @@ sudo chmod +x *.sh sudo bash install.sh # Add alias and Python script to .bashrc for the current user -sudo -u $CURRENT_USER bash -c "echo \"alias off='sudo /home/$CURRENT_USER/x735-v2.5/x735softsd.sh'\" >> /home/$CURRENT_USER/.bashrc" -sudo -u $CURRENT_USER bash -c "echo \"python3 /home/$CURRENT_USER/x735-v2.5/pwm_fan_control.py &\" >> /home/$CURRENT_USER/.bashrc" +sudo -u "$CURRENT_USER" bash -c "echo \"alias off='sudo $INSTALL_DIR/x735softsd.sh'\" >> /home/$CURRENT_USER/.bashrc" +sudo -u "$CURRENT_USER" bash -c "echo \"python3 $INSTALL_DIR/pwm_fan_control.py &\" >> /home/$CURRENT_USER/.bashrc" # Notify user -echo "Setup complete. Please open a new terminal for changes to take effect." \ No newline at end of file +echo "Setup complete. Please open a new terminal for changes to take effect."