-
-
Save oboje/4701efd8b77a5baa7dabc860e66b02a6 to your computer and use it in GitHub Desktop.
Dumping chia info to individual items to query via webserver endpoint
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 | |
source /home/your/path/to/chia-blockchain/activate | |
STR=$(chia farm summary | head -8) | |
FARM=$(chia farm summary | head -8 | sed 's/ /_/g; s/:_/=/g') #jq -Rs '{chia:split("\n")|map(split(": ")|{(.[0]):.[1]}?)}' | |
ACTIVE=$(pgrep -fa 'chia plots create' | wc -l) | |
printem() { | |
echo "Active_Plots=$ACTIVE" | |
echo "$FARM" | |
} | |
OUTPUT="$(printem | xargs | sed -e 's/ / /g')" | |
eval $OUTPUT | |
if [[ ! -d /tmp/chia ]]; then | |
mkdir -p /tmp/chia | |
fi | |
if [[ $Farming_status = "Farming" ]]; then | |
export FARM=true | |
else | |
export FARM=false | |
fi | |
echo "chia Active_plots=$ACTIVE" > /tmp/chia/active | |
echo "chia Farming_status=$FARM" > /tmp/chia/farmstat | |
echo "chia Total_chia_farmed=$Total_chia_farmed" > /tmp/chia/totalxch | |
echo "chia Block_rewards=$Block_rewards" > /tmp/chia/xchrewards | |
echo "chia Plot_count=$Plot_count" > /tmp/chia/plots | |
echo "chia Total_size_of_plots=$Total_size_of_plots" | rev | cut -c5- | rev > /tmp/chia/plotsize | |
echo "chia Estimated_network_space=$Estimated_network_space" | rev | cut -c5- | rev > /tmp/chia/netspace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment