source: freebsd-mgnt/system-update.sh@ 184

Last change on this file since 184 was 182, checked in by Rick van der Zwet, 14 years ago

Make it more user friendly

  • Property svn:executable set to *
File size: 885 bytes
RevLine 
[84]1#!/bin/sh
2# FreeBSD system upgade script
3#
4# Licence: BSDLike - http://rickvanderzwet.nl/LICENSE
5# Rick van der Zwet <info@rickvanderzwet.nl>
6
[182]7. /etc/rc.subr
8
[84]9if [ `id -u` -ne 0 ]; then
10 echo "Sorry root only" 1>&2
11 exit 128
12fi
13
[119]14DIRNAME=`dirname $0`
[182]15BATCH=${BATCH-""}
[84]16
[119]17$DIRNAME/port-list.sh
18
[84]19# Update port tree
[182]20echo "# Updating portstree .."
[84]21portsnap update
22
[182]23# Update ports listing
24echo "# Checking ports which needs updating ..."
[84]25NEWPORTS=`pkg_version -qL=`
[182]26
27if [ -z "$NEWPORTS" ]; then
28 echo "# System up2date"
29 exit 0
30fi
31
32if [ -z "$BATCH" ]; then
33 # Make sure we have read the (new) UPDATING announcements
34 less /usr/ports/UPDATING
35
36 echo $NEWPORTS
37 # And agree to the terms of the game
38 echo -n "Do you like to upgrade the affected ports [no]: "; read INPUT
39
40 INPUT=${INPUT:-"no"}
41 checkyesno INPUT || exit 1
42 echo "Foo"
43fi
44
[84]45portupgrade -r -mBATCH=yes -a $NEWPORTS
Note: See TracBrowser for help on using the repository browser.