mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-11-10 17:30:36 +08:00
Update 90-footer
This commit is contained in:
parent
09cc529800
commit
fa5e7cc860
1 changed files with 4 additions and 5 deletions
|
|
@ -6,11 +6,10 @@ UpdateLog="/var/log/packagesupdatefile.log"
|
||||||
if [ -f "$UpdateLog" ]; then
|
if [ -f "$UpdateLog" ]; then
|
||||||
rm -rf $UpdateLog
|
rm -rf $UpdateLog
|
||||||
fi
|
fi
|
||||||
apt-get update
|
apt update | tee -a "$UpdateLog" > /dev/null 2>&1
|
||||||
apt list --upgradable | awk 'END{print NR}' | tee -a "$UpdateLog" > /dev/null 2>&1
|
|
||||||
UpdateRemind=`cat $UpdateLog | tail -n 1`
|
UpdateRemind=`cat $UpdateLog | tail -n 1`
|
||||||
Result=$(echo $UpdateRemind)
|
Result=$(echo $UpdateRemind | grep "*packages can be upgraded*")
|
||||||
if [ "$Result" -ge "1" ]; then
|
if [ "$Result" != "" ]; then
|
||||||
printf "$UpdateRemind packages can be upgraded. Run 'apt list --upgradable' to see them.\n"
|
printf "$UpdateRemind"
|
||||||
fi
|
fi
|
||||||
rm -rf $UpdateLog
|
rm -rf $UpdateLog
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue