Skip to content

Commit

Permalink
lint: format yum.sh (#212)
Browse files Browse the repository at this point in the history
Signed-off-by: wangqing <wangqing@uniontech.com>
  • Loading branch information
wangqingfree committed May 9, 2024
1 parent 251b8a7 commit 18fcb1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ upgrades=$(check_upgrades)

echo '# HELP yum_upgrades_pending Yum package pending updates by origin.'
echo '# TYPE yum_upgrades_pending gauge'
if [[ -n "${upgrades}" ]] ; then
if [[ -n "${upgrades}" ]]; then
echo "${upgrades}"
else
echo 'yum_upgrades_pending{origin=""} 0'
fi

# If yum-utils/dnf-utils is not installed then we skip rendering this metric
if [[ -x /bin/needs-restarting ]] ; then
if [[ -x /bin/needs-restarting ]]; then
echo '# HELP node_reboot_required Node reboot is required for software updates.'
echo '# TYPE node_reboot_required gauge'
if /bin/needs-restarting -r > /dev/null 2>&1 ; then
if /bin/needs-restarting -r >/dev/null 2>&1; then
echo 'node_reboot_required 0'
else
echo 'node_reboot_required 1'
Expand Down

0 comments on commit 18fcb1c

Please sign in to comment.