apt update first
This commit is contained in:
parent
a374c65e6e
commit
3d01909226
|
@ -5,6 +5,8 @@ PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
|
|||
# vars gotify
|
||||
readonly TOKEN="<TOKEN_GOTIFY_APP>"
|
||||
|
||||
apt update -qq
|
||||
|
||||
#https://askubuntu.com/questions/269606/apt-get-count-the-number-of-updates-available
|
||||
num=`apt-get -q -y --ignore-hold --allow-change-held-packages --allow-unauthenticated -s dist-upgrade | /bin/grep ^Inst | wc -l`;
|
||||
|
||||
|
@ -17,5 +19,5 @@ else
|
|||
updates=$(echo $updates|tr -d '\n')
|
||||
OUT="There are **$num** updates: \r"
|
||||
OUT="${OUT} Packages: *$updates*"
|
||||
sh ./gotifypush.sh "Kerolap updates notifier" "$OUT" 5 $TOKEN
|
||||
sh ./gotifypush.sh "Example host updates notifier" "$OUT" 5 $TOKEN
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue