#!/bin/bash #---------------------------------------------------- # Version: 0.1.1.1 # Author: Florian "Bluewind" Pritz # # 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 | grep -o "Targets ([0-9]*)" | sed 's/Targets (//; s/)//') #$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