File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
addon/vserver_ssh_stats/app
custom_components/vserver_ssh_stats Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11REMOTE_SCRIPT = r'''
22set -e
3+ set -o pipefail
34export LC_ALL=C
45export LANG=C
56# CPU %
5758pkg_count=0
5859pkg_list=""
5960if command -v apt-get >/dev/null 2>&1; then
60- updates=$(apt-get -s upgrade 2>/dev/null | awk '/^Inst /{print $2}')
61+ # Ignore non-zero exit codes so the script keeps running even if the
62+ # package manager encounters an error or missing permissions.
63+ updates=$( (apt-get -s upgrade 2>/dev/null || true) | awk '/^Inst /{print $2}')
6164 pkg_count=$(echo "$updates" | wc -l)
6265 pkg_list=$(echo "$updates" | head -n 10 | tr '\n' ',' | sed 's/,$//')
6366elif command -v dnf >/dev/null 2>&1; then
64- updates=$(dnf -q check-update --refresh 2>/dev/null | awk '/^[[:alnum:].-]+[[:space:]]/ {print $1}')
67+ updates=$( ( dnf -q check-update --refresh 2>/dev/null || true) | awk '/^[[:alnum:].-]+[[:space:]]/ {print $1}')
6568 pkg_count=$(echo "$updates" | wc -l)
6669 pkg_list=$(echo "$updates" | head -n 10 | tr '\n' ',' | sed 's/,$//')
6770elif command -v yum >/dev/null 2>&1; then
68- updates=$(yum -q check-update 2>/dev/null | awk '/^[[:alnum:].-]+[[:space:]]/ {print $1}')
71+ updates=$( ( yum -q check-update 2>/dev/null || true) | awk '/^[[:alnum:].-]+[[:space:]]/ {print $1}')
6972 pkg_count=$(echo "$updates" | wc -l)
7073 pkg_list=$(echo "$updates" | head -n 10 | tr '\n' ',' | sed 's/,$//')
7174fi
Original file line number Diff line number Diff line change 11REMOTE_SCRIPT = r'''
22set -e
3+ set -o pipefail
34export LC_ALL=C
45export LANG=C
56# CPU %
You can’t perform that action at this time.
0 commit comments