Verified Commit 197f0d8f authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Feat(config): adds MINE_ONLY_IF_NO_SELECTED_KEY_EXISTS parameter

parent c87fbfcf
......@@ -40,6 +40,14 @@ fi
# Create folders
mkdir -p $CANDIDATES $LOGS
# Check if there are already selected keys
if [ "$MINE_ONLY_IF_NO_SELECTED_KEY_EXISTS" != "0" ]; then
if [ -L "$POOL/selected" ]; then
echo "$BASENAME: $CONFIG poll already have a selected key, and MINE_ONLY_IF_NO_SELECTED_KEY_EXISTS option is enabled. Skipping."
exit 1
fi
fi
# Check the total number of any existing candidates
if [ ! -z "$MAX_GENERATED_KEYS" ] && [ "$MAX_GENERATED_KEYS" != "0" ]; then
TOTAL_KEYS="`ls -1 $CANDIDATES | wc -l`"
......
......@@ -61,9 +61,13 @@ if [ -z "$CANDIDATE" ]; then
echo ""
echo "Available candidates in pool $CONFIG: "
echo ""
ls -1 $CANDIDATES | sed -e 's/^/ /'
[ -d "$CANDIDATES" ] && ls -1 $CANDIDATES | sed -e 's/^/ /'
echo ""
selected
echo ""
echo "Configured filters:"
echo ""
cat $POOL/filters.lst | sed -e 's/^/ /'
exit 1
fi
......
......@@ -134,3 +134,7 @@ RSYNC_EXCLUDES="--exclude=candidates --exclude=daemon --exclude=checkpoint.save
#
# Setting to "0" disables the limit.
#MAX_GENERATED_KEYS="0"
# Whether to mine keys only if a selected key does not already exists for a
# given pool.
MINE_ONLY_IF_NO_SELECTED_KEY_EXISTS="1"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment