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

postToMap.sh updates #1087

Merged
merged 18 commits into from
Mar 23, 2022
Merged

postToMap.sh updates #1087

merged 18 commits into from
Mar 23, 2022

Conversation

EricClaeys
Copy link
Collaborator

  • See individual commit comments for a list of the many changes.

* Use { } around variable names
* Use "<" instead of `cat`
* Use tabs with 4-character tabstop instead of spaces.
* Use { } around variables.
* Include ${ME} on all output statements.
To be consistent with other scripts, output information if called from the command line (i.e., ON_TTY = 1) or we're at the correct debug level.
* Check return code from curl.
* Check return from server script.
* Exit with non-zero code upon error.
* Use --silent option to curl to hide the progress information.
* Added `--delete` to delete map data
* Added `--help` to be consistent with other scripts that accept arguments
* Added `--debug` to aid in debugging
* Added missing "; then"
* Remove unused "OK"
* Added missing "; then"
* Check for required options and exit if not found.
* Check for suggested options and display warning if not there, but continue.
* Added missing "-e" and missing comma.
* Always upload on delete.
* Fixed how ${CMD} is executed.
* Implement "--force" to force an update - useful if it's the wrong day.
* Disabled some shellcheck errors.
* Save the full output from curl for use in error messages.
* Check for null reply from server.
* Check for additional required fields.
* Fixed bug with -n versus -z.
* Check for errors
* Improved message for "ALREADY UPDATED".
* --delete and --force both override the day check, so the old message is now misleading.
* Added "--whisper" argument to only display action taken and nothing else.
* Colors either use ${RED} or <span>, depending on who invokes us.
*
* This script is called by the WebUI when a setting changed, and that change should cause an action to be taken.
* In order for the WebUI to call postData.sh, it needs to do it via sudo.  This requires an entry in the sudoers file, which this installation script now creates if not there.
* Also added some shellcheck fixes.
* Because this is in $ALLSKY_SCRIPTS, set a placeholder for the actual location, which is replaced by the installation script.
* "postData.sh" is the newest entry in the sudoers file, so check for it instead of vcgencmd which used to be the newest entry.
@EricClaeys EricClaeys merged commit 8bbbd24 into master Mar 23, 2022
@EricClaeys EricClaeys deleted the postToMap-updates branch March 23, 2022 17:34
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.

None yet

2 participants