···2323echo "Cloning repository from GitHub..."
2424cd /home/ink
2525if [ -d "/home/ink/inky" ]; then
2626- cd /home/ink/inky
2727- git pull
2626+ read -p "Repository already exists. Would you like to update it? (y/n) " -n 1 -r
2727+ echo
2828+ if [[ $REPLY =~ ^[Yy]$ ]]; then
2929+ cd /home/ink/inky
3030+ git pull
3131+ # Just restart the service since it's an update
3232+ echo "Restarting camera service..."
3333+ systemctl restart camera.service
3434+ fi
2835else
2936 git clone https://github.com/taciturnaxolotl/inky.git
3030-fi
3131-chown -R ink:ink /home/ink/inky
32373333-# Copy camera_server.py to user's home directory
3434-echo "Setting up camera server..."
3535-cp /home/ink/inky/src/camera_server.py /home/ink/
3636-chown ink:ink /home/ink/camera_server.py
3737-chmod +x /home/ink/camera_server.py
3838+ chown -R ink:ink /home/ink/inky
38393939-# Copy and set up systemd service
4040-echo "Setting up systemd service..."
4141-cp /home/ink/inky/src/camera.service /etc/systemd/system/
4040+ # Copy camera_server.py to user's home directory
4141+ echo "Setting up camera server..."
4242+ cp /home/ink/inky/src/camera_server.py /home/ink/
4343+ chown ink:ink /home/ink/camera_server.py
4444+ chmod +x /home/ink/camera_server.py
42454343-# Test the camera
4444-echo "Testing camera..."
4545-if command -v rpicam-still &> /dev/null; then
4646- mkdir -p /tmp/camera_test
4747- if rpicam-still -o /tmp/camera_test/test.jpg; then
4848- echo "Camera test successful!"
4949- else
5050- echo "Camera test failed. Please check your camera connection."
5151- fi
5252-else
5353- echo "rpicam-still not found. Please make sure the camera is properly enabled."
4646+ # Copy and set up systemd service
4747+ echo "Setting up systemd service..."
4848+ cp /home/ink/inky/src/camera.service /etc/systemd/system/
4949+5050+ # Test the camera
5151+ echo "Testing camera..."
5252+ if command -v rpicam-still &> /dev/null; then
5353+ mkdir -p /tmp/camera_test
5454+ if rpicam-still -o /tmp/camera_test/test.jpg; then
5555+ echo "Camera test successful!"
5656+ else
5757+ echo "Camera test failed. Please check your camera connection."
5858+ fi
5959+ else
6060+ echo "rpicam-still not found. Please make sure the camera is properly enabled."
6161+ fi
6262+6363+ # Enable and start the service
6464+ echo "Enabling and starting camera service..."
6565+ systemctl daemon-reload
6666+ systemctl enable camera.service
6767+ systemctl start camera.service
5468fi
5555-5656-# Enable and start the service
5757-echo "Enabling and starting camera service..."
5858-systemctl daemon-reload
5959-systemctl enable camera.service
6060-systemctl start camera.service
61696270echo "Setup complete!"
6371echo "Camera server should now be running."