first commit
This commit is contained in:
29
external/packages/bsp/common/etc/update-motd.d/40-orangepi-updates
vendored
Executable file
29
external/packages/bsp/common/etc/update-motd.d/40-orangepi-updates
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||
#
|
||||
# This file is licensed under the terms of the GNU General Public
|
||||
# License version 2. This program is licensed "as is" without any
|
||||
# warranty of any kind, whether express or implied.
|
||||
|
||||
# DO NOT EDIT THIS FILE but add config options to /etc/default/orangepi-motd
|
||||
# any changes will be lost on board support package update
|
||||
|
||||
THIS_SCRIPT="updates"
|
||||
MOTD_DISABLE=""
|
||||
|
||||
[[ -f /etc/default/orangepi-motd ]] && . /etc/default/orangepi-motd
|
||||
|
||||
for f in $MOTD_DISABLE; do
|
||||
[[ $f == $THIS_SCRIPT ]] && exit 0
|
||||
done
|
||||
|
||||
NUM_UPDATES=0
|
||||
|
||||
[[ -f /var/cache/apt/archives/updates.number ]] && . /var/cache/apt/archives/updates.number
|
||||
|
||||
if [[ $NUM_UPDATES -gt 0 ]]; then
|
||||
echo -e "[\e[31m $NUM_SECURITY_UPDATES security updates available, $NUM_UPDATES updates total\e[0m: \e[1mapt upgrade\e[0m ]"
|
||||
echo -e "Last check: \e[92m$DATE\e[0m"
|
||||
echo
|
||||
fi
|
||||
Reference in New Issue
Block a user