From owner-freebsd-questions@FreeBSD.ORG Wed Nov 2 19:09:05 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E32B516A41F for ; Wed, 2 Nov 2005 19:09:05 +0000 (GMT) (envelope-from dennyboy@cableone.net) Received: from S1.cableone.net (s1.cableone.net [24.116.0.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79AEA43D45 for ; Wed, 2 Nov 2005 19:09:05 +0000 (GMT) (envelope-from dennyboy@cableone.net) Received: from dualman.cableone.net (unverified [69.92.7.117]) by S1.cableone.net (CableOne SMTP Service S1) with ESMTP id 36068079 for ; Wed, 02 Nov 2005 12:09:26 -0700 Date: Wed, 2 Nov 2005 13:08:44 -0600 (CST) From: Denny White To: FreeBSD Questions Message-ID: <20051102130253.E10061@dualman.cableone.net> X-GPG-PUBLIC_KEY: http://wwwkeys.nl.pgp.net X-GPG-FINGERPRINT: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-NotAscii: charset=us-ascii; X-IP-stats: Incoming Last 1, First 13, in=5, out=0, spam=0 X-External-IP: 69.92.7.117 X-Abuse-Info: Send abuse complaints to abuse@cableone.net Subject: Script help for updating routine X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2005 19:09:06 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a script, pasted in below, which does various things on a daily basis, like cvsup src, docs, ports, portsdb, portversion, portupgrade, & so on. I finally figured out how to do the if/then/else thing with the portversion-portupgrade part of the script, but I can't figure out what to do to bypass the docs install part if there are no new docs. Thanks for any help I can get on it. Script follows: #!/bin/sh # echo "Cvsup latest src and doc" cvsup -g -L 2 /root/srcdoc-supfile # # THIS THE PART IN QUESTION, THAT DOES # DOES THE DOCS. CUSTOM MAKEFILE IS FOR # ENGLISH ONLY. #G #send copious output to the bit bucket echo "Updating docs" echo "" cd /usr/doc cp Makefile.custom Makefile make install #make install > /dev/null # cd /root echo "Portsnap fetching and updating ports" echo "" portsnap fetch portsnap update # echo "Updating INDEX in /usr/ports" echo "" cd /usr/ports #make fetchindex portsdb -uUF # echo "Portaudit checking for vulnerabilities in installed ports" echo "Results in file /root/vulnerable" echo "" portaudit -Fda >> /root/vulnerable # echo "Portversion checking if any ports need upgrading" echo "Results in file /root/need2upgrade" echo "" portversion -l "<" > /root/need2upgrade if grep '<' /root/need2upgrade; then echo "Portupgrade upgrading out-of-date ports" portupgrade -arR; else echo "Ports already up to date" 1>&2 exit 1 fi echo "Finished at `/bin/date`." exit GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) Comment: Made with pgp4pine 1.76 iD8DBQFDaQ7Ny0Ty5RZE55oRAjYhAKCyDOKGhu86oAVu6Ml2ANf2Rt3vXwCfcs52 2V388qkRXw8Kiun8iR7rbiY= =Wscs -----END PGP SIGNATURE-----