an eink camera running on an rpi zero 2 w

feat: make configure gadget script have a default

dunkirk.sh 654cf94d 5b2fb2f7

verified
Changed files
+9 -11
+9 -11
configure-gadget.sh
··· 1 - #!/bin/bash 1 + #!/usr/bin/env bash 2 2 # setup_gadget_mode.sh - Script to configure USB gadget mode on a Raspberry Pi SD card 3 3 4 - # Check if running as root 5 - if [ "$EUID" -ne 0 ]; then 6 - echo "Please run as root" 7 - exit 1 8 - fi 9 - 10 4 # Check if SD card boot partition is provided 11 5 if [ $# -lt 1 ]; then 12 - echo "Usage: $0 /path/to/sd_card_boot_partition" 13 - exit 1 6 + if [ -d "/run/media/$(whoami)/bootfs" ]; then 7 + BOOT_PARTITION="/run/media/$(whoami)/bootfs" 8 + else 9 + echo "Usage: $0 /path/to/sd_card_boot_partition" 10 + exit 1 11 + fi 12 + else 13 + BOOT_PARTITION=$1 14 14 fi 15 - 16 - BOOT_PARTITION=$1 17 15 18 16 # Verify the boot partition exists 19 17 if [ ! -d "$BOOT_PARTITION" ]; then
setup.sh