summaryrefslogtreecommitdiffstats
path: root/update_checker.sh
blob: d89266f81032e701b8ae09501e37cbe611ebd2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#----------------------------------------------------
# Version:      0.1.1.1
# Author:       Florian "Bluewind" Pritz <flo@xssn.at>
#
# Licensed under WTFPL v2
#   (see COPYING for full license text)
#
#----------------------------------------------------
# Shows if package updates are available
#----------------------------------------------------
export LC_ALL=C
cmd="pacman -Qu"
pac_num=$($cmd | wc -l)
#$cmd | grep "Total Download Size: .*MB" | grep -o "[0-9].*"

if [ ! "$pac_num" ]; then
  pac_num=0
fi

if [ "$pac_num" -gt 0 ]; then
  echo "${HOSTNAME}: $pac_num"
else
  echo "${HOSTNAME}: ok"
fi