Skip to content

Commit 33c93a5

Browse files
authored
Merge pull request #5152 from AllskyTeam/Prepend-ALLSKY_-to-EXIT-codes
Prepend allsky to exit codes
2 parents c0b8018 + c6e87af commit 33c93a5

37 files changed

Lines changed: 121 additions & 122 deletions

html/includes/allskySettings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ function DisplayAllskyConfig() {
577577
$ok = runCommand($CMD, "", "success", false, "", $return_val);
578578

579579
$msg = "";
580-
// EXIT_PARTIAL_OK means there were problem(s) and nothing changed.
581-
if ($return_val === EXIT_PARTIAL_OK) {
580+
// ALLSKY_EXIT_PARTIAL_OK means there were problem(s) and nothing changed.
581+
if ($return_val === ALLSKY_EXIT_PARTIAL_OK) {
582582
$ok = false;
583583
} else {
584584
// If Allsky needs to be configured again, e.g., a new camera type/model,

html/includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ function runCommand($cmd, $onSuccessMessage, $messageColor, $addMsg=true, $onFai
11831183
if ($script !== "") {
11841184
echo "\n<!-- from $cmd -->$script\n";
11851185
}
1186-
if ($return_val > 0 && $return_val !== EXIT_PARTIAL_OK) {
1186+
if ($return_val > 0 && $return_val !== ALLSKY_EXIT_PARTIAL_OK) {
11871187
$r = "";
11881188
if ($modifiedResult !== null) {
11891189
$r = implode("<br>", $modifiedResult);

html/includes/systembuttonsutil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ private function runButtonCommand(string $command): array
529529
$message = trim(implode("\n", $output));
530530

531531
return [
532-
'ok' => ($returnCode === 0 || (defined('EXIT_PARTIAL_OK') && $returnCode === EXIT_PARTIAL_OK)),
532+
'ok' => ($returnCode === 0 || (defined('ALLSKY_EXIT_PARTIAL_OK') && $returnCode === ALLSKY_EXIT_PARTIAL_OK)),
533533
'code' => $returnCode,
534534
'output' => $message,
535535
'suggestions' => [],

remoteWebsiteInstall.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
ME="$( basename "${BASH_ARGV0}" )"
1212

1313
#shellcheck source-path=.
14-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
14+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1515
#shellcheck source-path=scripts
16-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
16+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1717
#shellcheck source-path=scripts
18-
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${EXIT_ERROR_STOP}"
18+
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1919
#shellcheck source-path=scripts
20-
source "${ALLSKY_SCRIPTS}/checkFunctions.sh" || exit "${EXIT_ERROR_STOP}"
20+
source "${ALLSKY_SCRIPTS}/checkFunctions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
2121

2222
# display_msg() sends log entries to this file.
2323
# shellcheck disable=SC2034
@@ -233,7 +233,7 @@ function pre_install_checks()
233233
DIALOG_TEXT+="$( dE_ "NOT WORKING." )"
234234
display_box "--infobox" "${DIALOG_PRE_CHECK}" "${DIALOG_TEXT}"
235235

236-
if [[ ${VALID_RET} -eq ${EXIT_ERROR_STOP} ]]; then
236+
if [[ ${VALID_RET} -eq ${ALLSKY_EXIT_ERROR_STOP} ]]; then
237237
if [[ -n ${GLOBAL_ERROR_MSG} ]]; then
238238
MSG="${GLOBAL_ERROR_MSG}"
239239
else
@@ -771,15 +771,15 @@ function check_if_website_is_valid()
771771
GLOBAL_ERROR_MSG="$( _check_web_connectivity --url "${REMOTE_WEBSITE_URL}" --from "install" )"
772772
RET=$?
773773
if [[ ${RET} -ne 0 ]]; then
774-
if [[ ${RET} -eq "${EXIT_PARTIAL_OK}" ]]; then
774+
if [[ ${RET} -eq "${ALLSKY_EXIT_PARTIAL_OK}" ]]; then
775775
# We only have basic connectivity so the site is probably empty
776776
# so the checks for files below will fail. Return now.
777777
MSG="Skipping remaining validity checks due to Basic Connectivity."
778778
display_msg --logonly info "${MSG}"
779779
return 0
780780
else
781781
display_msg --logonly info "${GLOBAL_ERROR_MSG}"
782-
return "${EXIT_ERROR_STOP}"
782+
return "${ALLSKY_EXIT_ERROR_STOP}"
783783
fi
784784
fi
785785

@@ -969,7 +969,7 @@ function usage_and_exit()
969969

970970
MSG="Usage: ${ME} [--help] [--debug] [--skipupload] [-auto] [--text]"
971971
echo -e "\n${C}${MSG}${cNC}"
972-
echo "where:"
972+
echo "Arguments:"
973973
echo " --help Displays this message and exits."
974974
echo " --debug Adds addtional debugging information to the installation log."
975975
echo " --skipupload Skips uploading of the remote Website code."

scripts/addMessage.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
ME="$( basename "${BASH_ARGV0}" )"
99

1010
#shellcheck disable=SC1091 source=variables.sh
11-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
11+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1212
#shellcheck source-path=scripts
13-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
13+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1414

1515
ARGS=$*
1616

@@ -54,7 +54,7 @@ usage_and_exit()
5454
wE_ "${MSG}"
5555
fi
5656
echo
57-
echo "where:"
57+
echo "Arguments:"
5858
echo " --cmd c displays 'c' as a link in the WebUI."
5959
echo " --delete if specified, only '--id ID' is required."
6060
echo " --no-date does not add the current date to the message."

scripts/checkAllsky.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
ME="$( basename "${BASH_ARGV0}" )"
1414

1515
#shellcheck disable=SC1091 source-path=.
16-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
16+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1717
#shellcheck source-path=scripts
18-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
18+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1919
#shellcheck source-path=scripts
20-
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${EXIT_ERROR_STOP}"
20+
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
2121
#shellcheck source-path=scripts
22-
source "${ALLSKY_SCRIPTS}/checkFunctions.sh" || exit "${EXIT_ERROR_STOP}"
22+
source "${ALLSKY_SCRIPTS}/checkFunctions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
2323

2424
usage_and_exit()
2525
{
@@ -873,7 +873,7 @@ else
873873
fi
874874
if [[ ${NUM_ERRORS} -gt 0 ]]; then
875875
echo -ne "${wERROR}Errors: ${NUM_ERRORS}${wNC}${wBR}"
876-
RET="${EXIT_ERROR_STOP}"
876+
RET="${ALLSKY_EXIT_ERROR_STOP}"
877877
fi
878878
fi
879879

scripts/checkFunctions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function _check_web_connectivity()
7474

7575
MSG="Got HTTP_STATUS ${HTTP_STATUS} from ${URL}; connectivity worked."
7676
[[ ${FROM} == "install" ]] && display_msg --logonly info "${MSG}"
77-
return "${EXIT_PARTIAL_OK}" # partial because it has basic connectivity only
77+
return "${ALLSKY_EXIT_PARTIAL_OK}" # partial because it has basic connectivity only
7878

7979
else
8080
case "${HTTP_STATUS}" in

scripts/copyNotificationImage.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
ME="$( basename "${BASH_ARGV0}" )"
66

77
#shellcheck disable=SC1091 source-path=.
8-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
8+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
99
#shellcheck source-path=scripts
10-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
10+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1111

1212
function usage_and_exit
1313
{

scripts/endOfDay.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
ME="$( basename "${BASH_ARGV0}" )"
66

77
#shellcheck source-path=.
8-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
8+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
99
#shellcheck source-path=scripts
10-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
10+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1111

1212
if [[ $# -eq 1 ]]; then
1313
if [[ ${1} == "--help" ]]; then

scripts/endOfNight.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ set -a
1010
ME="$( basename "${BASH_ARGV0}" )"
1111

1212
#shellcheck source-path=.
13-
source "${ALLSKY_HOME}/variables.sh" || exit "${EXIT_ERROR_STOP}"
13+
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1414
#shellcheck source-path=scripts
15-
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
15+
source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${ALLSKY_EXIT_ERROR_STOP}"
1616

1717
if [[ $# -eq 1 ]]; then
1818
if [[ ${1} = "--help" ]]; then

0 commit comments

Comments
 (0)