mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-16 06:05:33 +08:00
15 lines
450 B
Bash
15 lines
450 B
Bash
#!/bin/sh
|
|
# Authors:Leitbogioro
|
|
# https://github.com/leitbogioro/
|
|
# https://www.zhihu.com/column/originaltechnic
|
|
UpdateLog="/var/log/packagesupdatefile.log"
|
|
if [ -f "$UpdateLog" ]; then
|
|
rm -rf $UpdateLog
|
|
fi
|
|
apt update | tee -a "$UpdateLog" > /dev/null 2>&1
|
|
UpdateRemind=`cat $UpdateLog | tail -n 1`
|
|
Result=$(echo $UpdateRemind | grep "*packages can be upgraded*")
|
|
if [ "$Result" != "" ]; then
|
|
printf "$UpdateRemind"
|
|
fi
|
|
rm -rf $UpdateLog
|