From bd75a13a203b518c189cb9215d0aa0b5ee8d0641 Mon Sep 17 00:00:00 2001 From: Benedikt Böhm Date: Thu, 30 Oct 2008 18:07:05 +0100 Subject: commit initial version --- bin/porticron | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 bin/porticron (limited to 'bin/porticron') diff --git a/bin/porticron b/bin/porticron new file mode 100755 index 0000000..ab16f6e --- /dev/null +++ b/bin/porticron @@ -0,0 +1,55 @@ +#!/bin/bash + +SCRIPT_NAME=$(basename $0) +FQDN=$(hostname --fqdn) +IP=$(dig +short ${FQDN}) +DATE=$(date -R) +PORTDIR=$(portageq portdir) + +# only sync portage if PORTDIR is mounted read-write +if touch "${PORTDIR}"/.read_only_check &>/dev/null; then + rm -f "${PORTDIR}"/.read_only_check + /usr/bin/emerge --sync --quiet &>/dev/null +fi + +PACKAGES=$(/usr/bin/emerge --pretend --changelog --update --deep --newuse --quiet --usepkg world 2>/dev/null) + +if [[ -z ${PACKAGES} ]]; then + exit 0 +fi + +cat <