Last active
May 23, 2021 18:21
-
-
Save sonpython/ca9f5604613e0ff4b126740e6b90f0b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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