Skip to content

Instantly share code, notes, and snippets.

@sonpython
Last active May 23, 2021 18:21
Show Gist options
  • Save sonpython/ca9f5604613e0ff4b126740e6b90f0b7 to your computer and use it in GitHub Desktop.
Save sonpython/ca9f5604613e0ff4b126740e6b90f0b7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# auto clean and update new chia plots directory
# remove all plot directory in config.yaml
sed -i '/\ \ \-\ \/media\/.*$/d' ~/.chia/mainnet/config/config.yaml
# create tmp anchor - tmpdirectory
sed -i 's/\ \ plot_directories\:/\ \ plot_directories\:\n\ \ \- tmpdirectory/g' ~/.chia/mainnet/config/config.yaml
# add directory
COUNTER=0
for d in $1/*; do
# chia plots add -d "$d";
sed -i "s|\ \ plot_directories\:|\ \ plot_directories\:\n\ \ \- $d|g" ~/.chia/mainnet/config/config.yaml
COUNTER=$((COUNTER + 1))
echo "$COUNTER | Added $d"
done
# remove anchor - tmpdirectory
sed -i '/\ \ \-\ tmpdirectory$/d' ~/.chia/mainnet/config/config.yaml
echo "added $COUNTER directorie(s)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment