2008-10-29 19:29:05 +00:00

30 lines
583 B
Bash
Executable File

#!/bin/bash
set -e
#set -v
LIVE_SNIPPET_DIR=/opt/aus2/incoming/3
STAGING_DIR=/opt/aus2/snippets/staging
RSYNC=/usr/bin/rsync
SED=/bin/sed
if test -z $1; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
newSnippetDir=`echo $1 | $SED -e 's/\///'g`
if ! test -d $STAGING_DIR/$newSnippetDir; then
echo Usage: $0 [snippet-directory-to-sync-in from $STAGING_DIR]
exit 1
fi
# publish the new snippets
echo Running $RSYNC -PaO $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
$RSYNC -PaO $STAGING_DIR/$1/ $LIVE_SNIPPET_DIR
touch $LIVE_SNIPPET_DIR
exit 0