Date: Thu, 21 Jun 2007 16:38:17 +0200 (CEST) From: Oliver Fromme <olli@secnetix.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Oliver Fromme <olli@secnetix.de> Subject: conf/113913: New file: /etc/periodic/daily/490.status-pkg-changes Message-ID: <200706211438.l5LEcHrT002993@pluto.secnetix.de> Resent-Message-ID: <200706211500.l5LF0AX8008971@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 113913 >Category: conf >Synopsis: New file: /etc/periodic/daily/490.status-pkg-changes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 21 15:00:10 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 6.2-STABLE-20070615 i386 >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: FreeBSD RELENG_6 and HEAD (7-current) >Description: The script below adds a new status report to the daily periodic output: A paragraph that lists packages that have been added, updated or deleted in the past 24 hours. That information is particularly useful on servers that are maintained by multiple administrators. When someone adds, updates or deletes a package, the others will see it in the daily periodic output. Such a paragraph looks like this (example): Changes in installed packages: -gawk-3.1.1_1 The GNU version of Awk +gawk-3.1.5 The GNU version of Awk -ispell-3.2.06_17 An interactive spelling checker for multiple languages -w3m-0.5.1_6 A pager/text-based WWW browser +w3m-0.5.2 A pager/text-based WWW browser +zsh-4.3.2_1 The Z shell Of course, if there are no changes, nothing is displayed at all. The format is intentionally simple and compact. >How-To-Repeat: Save the script below as /etc/periodic/daily/490.status-pkg-changes and add this line to /etc/periodic.conf: daily_status_pkg_changes_enable="YES" Suggested default entry for /etc/defaults/periodic.conf: # 490.status-pkg-changes daily_status_pkg_changes_enable="NO" # Show package changes >Fix: #!/bin/sh - # Show which packages have been added, updated or deleted. # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi case "$daily_status_pkg_changes_enable" in [Yy][Ee][Ss]) if [ ! -f /usr/sbin/pkg_info ]; then echo '$daily_status_pkg_changes_enable is enabled but' \ "/usr/sbin/pkg_info doesn't exist" rc=2 else bak=/var/backups rc=0 if [ -f $bak/pkg_info.bak ]; then mv -f $bak/pkg_info.bak $bak/pkg_info.bak2 fi /usr/sbin/pkg_info > $bak/pkg_info.bak if ! cmp -sz $bak/pkg_info.bak $bak/pkg_info.bak2; then echo "" echo "Changes in installed packages:" diff -U 0 $bak/pkg_info.bak2 $bak/pkg_info.bak \ | grep '^[-+][^-+]' | sort -k 1.2 fi fi ;; *) rc=0 ;; esac exit $rc >Release-Note: >Audit-Trail: >Unformatted:home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706211438.l5LEcHrT002993>
