Skip to content

Commit 023698f

Browse files
authored
Update 20-update
1 parent 47f0506 commit 023698f

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

update-motd-static.d/20-update

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ function color (){
66

77
function setCountColor (){
88
local input=$1
9-
countColor="30;48;5;242"
9+
countColor="38;5;16;48;5;242"
1010

1111
if [ $input == 0 ]; then
12-
countColor="30;48;5;242"
12+
countColor="38;5;16;48;5;242"
1313
else
14-
countColor="30;48;5;71"
14+
countColor="38;5;16;48;5;71"
1515
fi
1616
}
1717

@@ -25,10 +25,10 @@ function msgFormat (){
2525
echo "package$packagesPlural"
2626
}
2727

28-
msgColor="30;38;5;103"
28+
msgColor="38;5;103"
2929

3030
# Count
31-
sudo apt-get update --quiet=2
31+
apt-get update --quiet=2
3232
pkgCount="$(apt-get -s dist-upgrade | grep -Po '^\d+(?= upgraded)')"
3333
setCountColor "$pkgCount"
3434

@@ -39,16 +39,15 @@ msgLabel="$(color $msgColor "$(msgFormat $pkgCount) can be upgraded")"
3939

4040
updateMsg=" $msgHeader $msgCount $msgLabel"
4141

42-
# Output To Dynamic File
42+
# Output To Static Script
4343
OUT="/etc/update-motd.d/"$(basename $0)
4444
exec >${OUT}
45-
#
4645
echo "#!/bin/bash"
47-
echo "####################################################"
48-
echo "# DO NOT EDIT THIS FILE #"
49-
echo "# EDIT [20-update] In [/etc/update-motd-static.d/] #"
50-
echo "####################################################"
51-
#
46+
echo
47+
echo "#####################################################"
48+
echo "# DO NOT EDIT THIS SCRIPT #"
49+
echo "# EDIT: /etc/update-motd-static.d/20-update #"
50+
echo "#####################################################"
5251
echo "cat <<EOF"
5352
echo -e "\n$updateMsg\n"
5453
echo "EOF"

0 commit comments

Comments
 (0)