source: src-sh/warden/scripts/backend/checkupdates.sh @ 0988d23

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 0988d23 was 0988d23, checked in by Kris Moore <kris@…>, 17 months ago

Add my working directory for the new warden backend changes.

Includes patches from John Hixson (john@…) to change
how warden uses "nicknames" instead of IP addresses for jail
identification.

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/bin/sh
2# Script to check for jail updates
3# Args $1 = JAILNAME
4######################################################################
5
6# Source our functions
7PROGDIR="/usr/local/share/warden"
8
9# Source our variables
10. ${PROGDIR}/scripts/backend/functions.sh
11
12JAILNAME="$1"
13
14if [ -z "${JAILNAME}" ]
15then
16  echo "ERROR: You must specify a jail to check"
17  exit 5
18fi
19
20if [ -z "${JDIR}" ]
21then
22  echo "ERROR: JDIR is unset!!!!"
23  exit 5
24fi
25
26JAILDIR="${JDIR}/${JAILNAME}"
27
28if [ ! -d "${JAILDIR}" -a "${JAILNAME}" != "all" ]
29then
30  echo "ERROR: No jail located at ${JAILDIR}"
31  exit 5
32fi
33
34
35# End of error checking, now start update checking
36#####################################################################
37
38# Check for updates
39if [ "${JAILNAME}" = "all" ] ; then
40  cd ${JDIR}
41  for i in `ls -d .*.meta`
42  do
43    HOST="`cat ${i}/host`"
44    set_warden_metadir
45    if [ -e "${JMETADIR}/jail-linux" ] ; then continue; fi
46
47    echo "Checking for jail updates to ${HOST}"
48    echo "################################################"
49 
50    # Check for meta-pkg updates
51    pc-metapkgmanager --chroot ${JDIR}/${HOST} checkup
52
53    # Check for system-updates
54    chroot ${JDIR}/${HOST} cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch'
55  done
56else
57  set_warden_metadir
58 
59  if [ -e "${JMETADIR}/jail-linux" ] ; then
60    echo "ERROR: Cannot check for updates to Linux Jails.. Please use any included Linux utilities for your disto."
61    exit 5
62  fi
63
64   echo "Checking for jail updates to ${HOST}..."
65   echo "################################################"
66   # Check for meta-pkg updates
67   pc-metapkgmanager --chroot ${JDIR}/${HOST} checkup
68
69   # Check for system-updates
70   chroot ${JDIR}/${HOST} cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch'
71fi
Note: See TracBrowser for help on using the repository browser.