mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 05:34:34 +08:00
Create 90-footer
This commit is contained in:
parent
f18cce054b
commit
4a9983df64
1 changed files with 16 additions and 0 deletions
16
Linux_reinstall/updatemotd/90-footer
Normal file
16
Linux_reinstall/updatemotd/90-footer
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/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`
|
||||
echo $UpdateRemind
|
||||
Result=$(echo $UpdateRemind | grep "*packages can be upgraded*")
|
||||
if [[ "$Result" != "" ]]; then
|
||||
printf "$UpdateRemind"
|
||||
fi
|
||||
rm -rf $UpdateLog
|
Loading…
Reference in a new issue