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

Remove legacy, pre-0.8.3 code #1016

Merged
merged 18 commits into from
Feb 12, 2022
Merged

Remove legacy, pre-0.8.3 code #1016

merged 18 commits into from
Feb 12, 2022

Conversation

EricClaeys
Copy link
Collaborator

Remove checks for CAMERA=auto.
Remove checks for obsolete variable names.
Merge functionality of scripts/filename.sh into config/config.sh (almost every script that sources in config.sh also sourced in filename.sh).

Stop the allsky service on fatal errors since the next execution of allsky will also fail, getting us into an infinite loop.
Exit with 100 on fatal errors for a future change where systemctl will not restart the service for error codes >= 100.
Add color to some error messages
Handle exit codes 98 and 99 from the capture programs (which will be added via a separate PR).
Add initial code for trying to determine if the service is restarting, versus stopping.  On a restart we can display a message "Allsky software is restarting" and skip the "Allsky software is not running" message that appears when the service stops.  I'm pretty sure there's a way with systemctl that allows it to send a different signal on stop versus restart.  allsky.sh and the capture programs could then check which signal was sent.
First pass at removing the legacy / compatibility code.
Assume this file is used with version 0.8.3 or later, so remove the code that made it compatible with older releases.
Move the functionality of the scripts/filename.sh file here, since almost every time config.sh is sourced in, so is filename.sh.
In preparation for an Allsky update script, add a variable that will tell the script when to stop looking for user-settable variables.
The script will use the new config.sh file but will copy the user's settings from the old config.sh to the new file, stopping at END_OF_USER_SETTINGS.
Assume this version runs with 0.8.3 so there's no need for legacy code to handle CAMERA=auto or to check for obsolete variables.  This simplifies the code somewhat.
Remove duplicate check for reset_usb.
The functionality of scripts/filename.sh was moved to config/config.sh so no need to source in filename.sh
Also remove unneeded compatibility code
@EricClaeys
Copy link
Collaborator Author

Fixes #1004

Its functionality was moved to config.sh
to keep workflow checker happy
Copy link
Collaborator

@AndreasLMeg AndreasLMeg left a comment

Choose a reason for hiding this comment

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

No mistakes found, but not tested

@EricClaeys
Copy link
Collaborator Author

EricClaeys commented Feb 12, 2022

@AndreasLMeg FAN_DATA_FILE is a new setting in config.sh that points to the optional file that contains the fan speed and percent. It's set to "" in config.sh; the "-v" checks if it's not set to anything, i.e., it doesn't exist. If so, the user has an old config.sh file.
I learned about "-v" today. It takes the NAME of the variable, not the variable contents, so "[ -v FAN_DATA_FILE ]" is correct.

Do you think you'll have a chance to test this PR? I'm running it without any problems.

@linuxkidd linuxkidd merged commit aefa2c9 into master Feb 12, 2022
@EricClaeys EricClaeys deleted the allsky.sh-improvements branch February 12, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants