Update 40-updates MOTD script

This commit is contained in:
zador-blood-stained 2016-06-18 13:31:00 +03:00
parent 5f913b0575
commit 9e69ff26e2
2 changed files with 7 additions and 13 deletions

View File

@ -91,7 +91,7 @@ esac
PACKAGE_LIST="automake bash-completion bc bridge-utils build-essential cmake cpufrequtils device-tree-compiler \
dosfstools figlet fbset fping git hostapd ifenslave-2.6 iw libtool libwrap0-dev libssl-dev lirc fake-hwclock \
wpasupplicant libusb-dev libusb-1.0-0-dev psmisc ntp parted pkg-config rsync sudo curl dialog crda wireless-regdb \
ncurses-term python-apt sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils wireless-tools libnl-3-dev \
ncurses-term python3-apt sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils wireless-tools libnl-3-dev \
console-setup console-data console-common unicode-data openssh-server initramfs-tools ca-certificates"
# Non-essential packages
@ -116,12 +116,12 @@ case $RELEASE in
;;
jessie)
PACKAGE_LIST_RELEASE="less makedev kbd libnl-genl-3-dev libpam-systemd iperf3 \
software-properties-common python-software-properties libnss-myhostname f2fs-tools libnl-genl-3-dev"
software-properties-common libnss-myhostname f2fs-tools libnl-genl-3-dev"
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mozo pluma iceweasel libreoffice-writer libreoffice-java-common icedove gvfs policykit-1 policykit-1-gnome eject"
;;
trusty)
trusty)
PACKAGE_LIST_RELEASE="man-db wget nano libnl-genl-3-dev software-properties-common iperf \
python-software-properties f2fs-tools acpid"
f2fs-tools acpid"
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP libreoffice-writer libreoffice-java-common thunderbird firefox gnome-icon-theme-full tango-icon-theme gvfs-backends"
PACKAGE_LIST_EXCLUDE="ureadahead plymouth"
;;

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
#
# 40-updates - create the list of packages for update with caching
# Copyright (c) 2015 Igor Pecovnik
@ -28,7 +28,6 @@ import os
import os.path as path
def refreshdata ():
# update procedure
DISTRO = subprocess.Popen(["lsb_release", "-c", "-s"],
stdout=subprocess.PIPE).communicate()[0].strip()
@ -129,7 +128,7 @@ def refreshdata ():
# if the file is older than 2 days
myfile="/var/cache/apt/archives/updates.number"
myfile = os.environ['HOME'] + "/.cache/updates.number"
now = time.time()
twodays_ago = now - 60*60*24*2 # Number of seconds in two days
lastupgrade = os.stat('/var/cache/apt/archives').st_mtime
@ -143,12 +142,7 @@ else:
# display if there are some upgrades
file = open(myfile, 'r+')
file = open(myfile, 'r+')
updates = int(file.read())
if updates > 0:
print("[ \033[92m%d updates to install\033[0m: apt-get upgrade ]\n" % (updates))