an eink camera running on an rpi zero 2 w
1
fork

Configure Feed

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

feat: add update feature for setup script

dunkirk.sh 4a90d13e c285b24c

verified
+23
+23
setup.sh
··· 1 1 #!/bin/bash 2 2 # inky_setup.sh - auto setup the inky server 3 3 4 + # Check if this is being run from a file 5 + if [ -f "$0" ]; then 6 + echo "Checking for updated setup script..." 7 + LATEST=$(curl -s https://raw.githubusercontent.com/taciturnaxolotl/inky/refs/heads/main/setup.sh) 8 + LATEST_HASH=$(echo "$LATEST" | sha256sum | cut -d' ' -f1) 9 + CURRENT_HASH=$(cat "$0" | sha256sum | cut -d' ' -f1) 10 + if [ $? -eq 0 ] && [ ! -z "$LATEST" ] && [ "$LATEST_HASH" != "$CURRENT_HASH" ]; then 11 + echo "Applying latest version..." 12 + echo "$LATEST" > "$0" 13 + exec "$0" "$@" 14 + exit 0 15 + fi 16 + else 17 + echo "Creating setup script file..." 18 + curl -s https://raw.githubusercontent.com/taciturnaxolotl/inky/refs/heads/main/setup.sh > setup.sh 19 + chmod +x setup.sh 20 + exec ./setup.sh "$@" 21 + exit 0 22 + fi 23 + 4 24 # Check if running as root 5 25 if [ "$EUID" -ne 0 ]; then 6 26 echo "Please run as root or with sudo" ··· 23 43 # Just restart the service since it's an update 24 44 echo "Restarting camera service..." 25 45 systemctl restart camera.service 46 + else 47 + echo "Okay, not updating" 48 + exit 26 49 fi 27 50 else 28 51 # Update system packages and install dependencies