Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Hassbian-config: share-log errorhandling #129

Merged
merged 5 commits into from
Mar 7, 2018
Merged

Hassbian-config: share-log errorhandling #129

merged 5 commits into from
Mar 7, 2018

Conversation

ludeeus
Copy link
Member

@ludeeus ludeeus commented Mar 4, 2018

Description:

This will better handle errors if hastebin is down.

Compare:

Old:
image

New:
image

Checklist:

  • The code change is tested and works locally.
  • [N/A] Script has validation check of the job.

If pertinent:

  • [N/A] Created/Updated documentation at /docs

@ludeeus ludeeus added this to the v0.8.0 milestone Mar 4, 2018
@ludeeus ludeeus added this to To do in v0.8.0 via automation Mar 4, 2018
@ludeeus ludeeus moved this from To do to In progress in v0.8.0 Mar 4, 2018
a=$(cat $LOGFILE); curl -X POST -s -d "$a" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}'
loglink=$(curl -X POST -s -d "$(cat $LOGFILE)" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}')
if [[ $loglink != *"initial"* ]]; then
echo $loglink

Choose a reason for hiding this comment

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

Double quote to prevent globbing and word splitting.

a=$(cat $LOGFILE); curl -X POST -s -d "$a" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}'
loglink=$(curl -X POST -s -d "$(cat $LOGFILE)" https://hastebin.com/documents | awk -F '"' '{print "https://hastebin.com/"$4}')
if [[ $loglink != *"initial"* ]]; then
echo $loglink

Choose a reason for hiding this comment

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

Double quote to prevent globbing and word splitting.

Copy link
Collaborator

@Landrash Landrash left a comment

Choose a reason for hiding this comment

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

Some cleanup of the spelling is needed.

if [[ $loglink != *"initial"* ]]; then
echo "$loglink"
else
echo "There is an issue with your network conection, or with the hastebin API.."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Capital H in Hastebin.

@@ -80,17 +80,35 @@ function check-permission {
}

function share-log {
if [ ! -f $LOGFILE ];then
echo "No logfile exiting..."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing comma.
No logfile, exiting.

echo "$loglink"
else
echo
echo "There is an issue with your network conection, or with the hasebin API.."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spelling:

"There is an issue with your network connection, or with the Hastebin API."

Copy link
Collaborator

@Landrash Landrash left a comment

Choose a reason for hiding this comment

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

Corrected spelling. Merging

@Landrash Landrash merged commit f2a9f46 into home-assistant:dev Mar 7, 2018
v0.8.0 automation moved this from In progress to Done Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v0.8.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants