Skip to content

Commit 9026d15

Browse files
authored
Update getRPiCameraInfo.sh: Use E_()
Also, remove check for raspistill which is only for Buster
1 parent 1c5a894 commit 9026d15

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

scripts/utilities/getRPiCameraInfo.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ while [[ $# -gt 0 ]]; do
2626
shift
2727
;;
2828
-*)
29-
echo -e "${RED}Unknown argument '${ARG}'.${NC}" >&2
29+
E_ "Unknown argument '${ARG}'." >&2
3030
OK="false"
3131
;;
3232
esac
@@ -36,26 +36,24 @@ done
3636
usage_and_exit()
3737
{
3838
local RET=${1}
39-
{
40-
echo
41-
[[ ${RET} -ne 0 ]] && echo -en "${RED}"
42-
echo "Usage: ${ME} [--help] [--camera NUM]"
43-
[[ ${RET} -ne 0 ]] && echo -en "${NC}"
44-
echo " where:"
45-
echo " '--help' displays this message and exits."
46-
echo " '--camera NUM' use camera number NUM."
47-
exit "${RET}"
48-
} >&2
39+
exec >&2
40+
echo
41+
local USAGE="Usage: ${ME} [--help] [--camera NUM]"
42+
if [[ ${RET} -ne 0 ]]; then
43+
E_ "${USAGE}"
44+
else
45+
echo -e "${USAGE}"
46+
fi
47+
echo "where:"
48+
echo " --help displays this message and exits."
49+
echo " --camera NUM use camera number NUM."
50+
exit "${RET}"
4951
}
5052

5153
[[ ${DO_HELP} == "true" ]] && usage_and_exit 0
5254
[[ ${OK} == "false" ]] && usage_and_exit 1
5355

5456
CMD="$( determineCommandToUse "false" "" "false" )" || exit 1
55-
if [[ ${CMD} == "raspistill" ]]; then
56-
echo "${ME} does not work with raspistill." >&2
57-
exit 1
58-
fi
5957

6058
export LIBCAMERA_LOG_LEVELS="ERROR,FATAL"
6159
CAMERA_DATA="${ALLSKY_TMP}/camera_data.txt"

0 commit comments

Comments
 (0)