This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

1#!/bin/bash 2# inky_setup.sh - auto setup the inky server 3 4# Check if running as root 5if [ "$EUID" -ne 0 ]; then 6 echo "Please run as root or with sudo" 7 exit 1 8fi 9 10echo "Setting up Inky camera server from GitHub repository..." 11 12# Update system packages and install dependencies 13echo "Updating package lists and installing dependencies..." 14apt update 15apt install -y python3-picamera2 python3-websockets python3-rpi.gpio git 16 17# Create directory for storing photos 18echo "Creating photos directory..." 19mkdir -p /home/ink/photos 20chown ink:ink /home/ink/photos 21 22# Clone the repository 23echo "Cloning repository from GitHub..." 24cd /home/ink 25if [ -d "/home/ink/inky" ]; then 26 cd /home/ink/inky 27 git pull 28else 29 git clone https://github.com/taciturnaxolotl/inky.git 30fi 31chown -R ink:ink /home/ink/inky 32 33# Copy camera_server.py to user's home directory 34echo "Setting up camera server..." 35cp /home/ink/inky/src/camera_server.py /home/ink/ 36chown ink:ink /home/ink/camera_server.py 37chmod +x /home/ink/camera_server.py 38 39# Copy and set up systemd service 40echo "Setting up systemd service..." 41cp /home/ink/inky/src/camera.service /etc/systemd/system/ 42 43# Test the camera 44echo "Testing camera..." 45if command -v rpicam-still &> /dev/null; then 46 mkdir -p /tmp/camera_test 47 if rpicam-still -o /tmp/camera_test/test.jpg; then 48 echo "Camera test successful!" 49 else 50 echo "Camera test failed. Please check your camera connection." 51 fi 52else 53 echo "rpicam-still not found. Please make sure the camera is properly enabled." 54fi 55 56# Enable and start the service 57echo "Enabling and starting camera service..." 58systemctl daemon-reload 59systemctl enable camera.service 60systemctl start camera.service 61 62echo "Setup complete!" 63echo "Camera server should now be running." 64echo "You can access the web interface at: http://inky.local" 65echo "Check service status with: sudo systemctl status camera"