source: tags/confman-1.5.2/confsync.sh @ 144

Revision 144, 1.4 KB checked in by ccowart, 5 years ago (diff)

Fixed the paths to the includes.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1#! /bin/bash
2
3##
4# This script obtains the latest "export" from confman and installs
5# it onto the system. It is intended to be used in crons as the
6# configuration pulling mechanism.
7#
8# Author:   Chris Cowart <ccowart@rescomp.berkeley.edu>
9#           4 December 2006
10#
11# $Id$
12##
13
14. /usr/local/rescomp/lib/confmancommon.sh
15
16# If we're in debug mode, we should log stderr messages to the logger
17# as well. Otherwise, we send them to the bit bucket.
18if $DEBUG ; then
19    exec 1>&2
20else
21    exec 1>/dev/null
22fi
23
24# Set up our "Working Copy"
25tarball=$(conf_fetch)
26tmpdir=$(mktemp -d -t confman)
27
28tar -xzf $tarball -C $tmpdir
29rm -rf $tarball
30WORK_PATH="$tmpdir"
31
32tar_revision=`conf_revision`
33sys_revision=`conf_sysrev`
34last_action=$(conf_lastact)
35
36if [ "x$last_action" = "xinstall" ] && [ $tar_revision -lt $sys_revision ]
37then
38    echo "Error: File system may be dirty." \
39        "A commit operation is recommended." >&2
40    echo "Error: $tarball is out of date. Exiting without making changes." >&2
41    conf_markdirty
42    rm -rf $tmpdir
43    exit 1
44fi
45
46if [ $tar_revision -lt $sys_revision ] ; then
47    exit 0
48fi
49
50exit
51
52echo "Sync operation started" >&2
53for layer in $LAYERS ; do
54        echo "Rolling on $layer..."
55        conf_rollout $layer || conf_cleanexit
56done
57for file in $SINGULARITIES ; do
58    echo "Assembing singularity $file..."
59        conf_assemble_sing $file || conf_cleanexit
60done
61conf_markclean
62conf_recordAction sync
63echo "Sync operation finished successfully" >&2
64
65rm -rf $tmpdir
66
Note: See TracBrowser for help on using the repository browser.