Skip to content

Commit

Permalink
Update install.sh: Warn in no RPi camera command was found
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Dec 8, 2024
1 parent e6e9b44 commit 41673fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,11 @@ CT=() # Camera Type array - what to display in whiptail

get_connected_cameras()
{
local CMD CC MSG NUM_RPI=0 NUM_ZWO=0
local CMD CMD_RET CC MSG NUM_RPI=0 NUM_ZWO=0

# true == ignore errors. ${CMD} will be "" if no command found.
CMD="$( determineCommandToUse "false" "" "true" 2> /dev/null )"
CMD_RET=$? # return of 2 means no command was found
setup_rpi_supported_cameras "${CMD}" # Will create full file is CMD == ""

# RPi format: RPi \t camera_number \t camera_sensor [\t optional_other_stuff]
Expand Down Expand Up @@ -358,7 +359,12 @@ get_connected_cameras()
whiptail --title "${TITLE}" --msgbox "${MSG}" 12 "${WT_WIDTH}" 3>&1 1>&2 2>&3

MSG="No connected cameras were detected."
display_msg --log error "${MSG}"
local MSG2=""
if [[ ${CMD_RET} -eq 2 ]]; then
MSG2="No command to take RPi images was found"
MSG2+=" - make sure 'libcamera-apps' is installed if you have an RPi camera."
fi
display_msg --log error "${MSG}" "${MSG2}"
exit_installation 1 "${STATUS_NO_CAMERA}" ""
fi

Expand Down

0 comments on commit 41673fe

Please sign in to comment.