Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generateForDay.sh: upload message fix #868

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/generateForDay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ if [ "${DO_TIMELAPSE}" = "true" ] ; then
fi


if [ "${TYPE}" = "GENERATE" -a ${SILENT} = "false" ]; then
if [ "${TYPE}" = "GENERATE" -a ${SILENT} = "false" -a ${EXIT_CODE} -eq 0 ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIT_CODE generation is a little bit confusing and result is maybe wrong - but not critical

pi@allsky:~/allsky $ A=0
pi@allsky:~/allsky $ B=1
pi@allsky:~/allsky $ C=-1
pi@allsky:~/allsky $ echo $((${A}+${B}+${C}))
0

-a is depricated (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html)

The XSI extensions specifying the -a and -o binary primaries and the '(' and ')' operators have been marked obsolescent. (Many expressions using them are ambiguously defined by the grammar depending on the specific expressions being evaluated.) Scripts using these expressions should be converted to the forms given below. Even though many implementations will continue to support these obsolescent forms, scripts should be extremely careful when dealing with user-supplied input that could be confused with these and other primaries and operators. Unless the application developer knows all the cases that produce input to the script, invocations like:

test "$1" -a "$2"

should be written as:

test "$1" && test "$2"

to avoid problems if a user supplied values such as $1 set to '!' and $2 set to the null string. That is, in cases where maximal portability is of concern, replace:

test expr1 -a expr2

ARGS=""
[ "${DO_KEOGRAM}" = "true" ] && ARGS="${ARGS} -k"
[ "${DO_STARTRAILS}" = "true" ] && ARGS="${ARGS} -s"
Expand Down