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

allsky.sh compatibility checks #626

Merged
merged 1 commit into from
Oct 10, 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
33 changes: 28 additions & 5 deletions allsky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,33 @@ fi

# Reset auto camera selection, so config.sh does not pick up old camera selection.
> "${ALLSKY_CONFIG}/autocam.sh"
source "${ALLSKY_CONFIG}/config.sh"

# COMPATIBILITY CHECKS
# config.sh moved to a new location in version 0.8.1. Check for it.
# Check for a new variable in config.sh that wasn't in prior versions.
# If not found, force the user to upgrade config.sh
if [ -f "${ALLSKY_CONFIG}/config.sh" ]; then
source "${ALLSKY_CONFIG}/config.sh"
RET=$?
if [ -z "${ALLSKY_DEBUG_LEVEL}" ]; then
echo "${RED}*** ERROR: old version of config.sh detected.${NC}"
RET=1
fi
else
echo "${RED}*** ERROR: cannot find config.sh.${NC}"
RET=1
fi
if [ ${RET} -ne 0 ]; then
echo "Please make a backup of your config.sh, ftp-settings.sh, and settings_*.json files,"
echo "then do a full re-install of AllSky."
echo "After the re-install, copy your settings from the backup files to the new files."
echo "Do NOT simply copy the old files over the new ones since several variables have been added or changed names."

"${ALLSKY_SCRIPTS}/copy_notification_image.sh" "Error" 2>&1
sudo systemctl stop allsky
exit 1
fi

mkdir -p "${ALLSKY_TMP}"

# Make sure allsky.sh is not already running.
Expand Down Expand Up @@ -152,10 +178,7 @@ ARGUMENTS+=(-daytime $DAYTIME_CAPTURE)

[ "$ADD_PARAMS" != "" ] && ARGUMENTS+=($ADD_PARAMS) # Any additional parameters

for A in ${ARGUMENTS[@]}
do
echo "${A}"
done > $ALLSKY_TMP/capture_args.txt
echo "${ARGUMENTS[@]}" > ${ALLSKY_TMP}/capture_args.txt

if [[ $CAMERA == "ZWO" ]]; then
CAPTURE="capture"
Expand Down