Skip to content
Snippets Groups Projects
Commit 1858a746 authored by Patrick Cernko's avatar Patrick Cernko
Browse files

fix: bail out if arc dir already exists to avoid arc2webarc.pl getting interactive

parent 929ac11f
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,16 @@ if [ ! -f "$MBOX_FILE" ]; then
echo "$SYNTAX" >&2
exit 1
fi
if [ ! -d "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME" ]; then
if [ ! -d $SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME ]; then
echo "Missing or invalid list name!" >&2
echo "$SYNTAX" >&2
exit 1
fi
arcdir=$SYMPA_ROOT/arc/$LIST_NAME@$SYMPA_DOMAIN
if [ -e $arcdir ]; then
echo "ERROR: arc dir '$arcdir' already exists, please clean up first" >&2
exit 1
fi
# Create archives directory if not yet done
mkdir -p "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives"
......@@ -61,7 +66,7 @@ pushd "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives"
# Convert to Sympa text archives
echo "Step 2: converting $MBOX_BACKUP into .log files" >&2
$base/mbox2sympa.pl $MBOX_BACKUP
rm $MBOX_BACKUP
rm -f $MBOX_BACKUP
chown -R $SYMPA_USER "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives"
chmod -R g=rX,o= "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment