source: tags/confman-1.5.6a1/export.sh @ 168

Revision 168, 1.3 KB checked in by ccowart, 5 years ago (diff)

Assisting confman developers by allowing ./confman to source dev libs.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1#! /bin/bash
2
3##
4# This script prepares an "export" of the confman repository for system
5# processes to be able to pull. It is intended to be prepared regularly
6# by a cron. It may be useful to modify this script to only prepare
7# the export if the repository's most recent commit post-dates the
8# tarball.
9#
10# Author:   Chris Cowart <ccowart@rescomp.berkeley.edu>
11#           4 December 2006
12#
13# $Id$
14##
15
16# Try loading a development library first
17if [ -r ./confmancommon.sh ] ; then
18    echo "Loading development library from current working directory." >&2
19    . ./confmancommon.sh
20elif [ -r /usr/local/rescomp/lib/confmancommon.sh ] ; then
21    . /usr/local/rescomp/lib/confmancommon.sh
22else
23    echo "Can't find confmancommon.sh. Exiting." >&2
24fi
25
26# If we're in debug mode, we should log stderr messages to the logger
27# as well. Otherwise, we send them to the bit bucket.
28if $DEBUG ; then
29    exec 1>&2
30else
31    exec 1>/dev/null
32fi
33
34REPO_URI="file://$REPO_PATH"
35backup=`mktemp -t confman`
36
37echo "Backing up $CONF_EXPORT_FILE"
38cp $CONF_EXPORT_FILE $backup
39
40echo "Beginning export operation." | conf_logger
41if ! conf_export $CONF_EXPORT_FILE ; then
42    echo "The export failed. Restoring $CONF_EXPORT_FILE from backup." >&2
43    mv $backup $CONF_EXPORT_FILE
44    echo "Exiting." >&2
45    exit 1
46fi
47echo "Export complete." | conf_logger
48
49echo "Removing $backup"
50rm $backup
51
Note: See TracBrowser for help on using the repository browser.