updated the code below to working code, along with a working payload for curl.[/b]
EDIT: There was one field missing '_ant_voltage'
Thanks for catching that! I actually discovered that I had left out _ant_voltage shortly after, at first I had tested changing from Enhanced -> Normal so I simply assumed everything worked.
I should have posted back here earlier, but unfortunately I've had to take a break from mining for the moment, until we launch a new facility. To make up for it I'd like to share the bash script I've got for this so far.
#!/bin/bash
# Antminer configuration via web portal
# Argument1 = IP Address
# Argument2 = Web Password
if timeout 1 ping -c 1 $1 &> /dev/null
then
# Check firmware version
version=$(curl -s --anyauth --user root:$2 $1/cgi-bin/get_system_info.cgi | jq '.system_filesystem_version')
echo "Firmware Version: $version"
# Get current pool settings
names=(_ant_pool1url _ant_pool1user _ant_pool1pw _ant_pool2url _ant_pool2user _ant_pool2pw _ant_pool3url _ant_pool3user _ant_pool3pw _ant_nobeeper _ant_notempoverctrl _ant_fan_customize_switch _ant_fan_customize_value _ant_freq _ant_voltage _ant_asic_boost _ant_low_vol_freq _ant_economic_mode _ant_multi_level)
mapfile -t pools < <(curl -s --anyauth --user root:$2 $1/cgi-bin/minerConfiguration.cgi | grep -e '"url' -e '"user' -e '"pass' | cut -d ":" -f2- | cut -d '"' -f2)
pools+=('false') #nobeeper
pools+=('false') #notempoverctrl
pools+=('false') #fan_customize_switch
pools+=('') #fan_customize_value
pools+=('') #freq
pools+=('0706') #voltage
# Nov 2018 ends here
pools+=('false') #asic_boost
pools+=('false') #low_vol_freq
pools+=('false') #economic_mode
# Dec 2018 ends here
pools+=('240') #multi_level
# Set configuration
data=$(for ((i=0; i< "${#names[@]}"; i++)) do printf "%s=%s&" "${names[$i]}" "${pools[$i]}"; done)
data=$(echo "${data%?}" | sed 's/:/%3A/g')
curl --anyauth --user root:$2 -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST -d "$data" "http://$1/cgi-bin/set_miner_conf.cgi"
else
echo "EXIT: Miner offline"
fi
Also I'm wondering if anyone knows what "economic_mode" is and/or if it does anything. It is present in the Dec 2018 & May 2019 payloads and there's also a hidden checkbox for it on the configuration cgi page. Doesn't seem to do anything as far as I can tell.