diff options
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index f1370c5609..fc8b39cdd5 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -533,7 +533,17 @@ newer_commit_date() { info "Checking if a newer version of the updater script is available." commit_check_url="https://api.github.com/repos/netdata/netdata/commits?path=packaging%2Finstaller%2Fnetdata-updater.sh&page=1&per_page=1" - python_version_check="from __future__ import print_function;import sys,json;data = json.load(sys.stdin);print(data[0]['commit']['committer']['date'] if isinstance(data, list) else '')" + python_version_check=" +from __future__ import print_function +import sys, json + +try: + data = json.load(sys.stdin) +except: + print('') +else: + print(data[0]['commit']['committer']['date'] if isinstance(data, list) and data else '') +" if command -v jq > /dev/null 2>&1; then commit_date="$(_safe_download "${commit_check_url}" /dev/stdout | jq '.[0].commit.committer.date' 2>/dev/null | tr -d '"')" |