# Antminer S9 logic for returning miner type and ASICboost status
# Developed by tim-bc
# 2018-11-21 to 2018-12-27
# Argument 1 = IPv4 Address
# Output = (Standard / Boosted) (Miner Model)
# Typical Outputs:
#
# Standard S9
# Standard S9i
# Standard S9j
# Boosted S9
# Boosted S9i
# Boosted S9j
# Enhanced S9
# Enhanced S9i
# Enhanced S9j
# Bugged S9
# Unknown
wisdom=`echo -n 'stats' | nc -w2 $1 4028 | tr ',|' '\n'`;
model=`echo "${wisdom##*Type=Antminer }" | head -1`;
date=`echo "${wisdom##*CompileTime=}" | head -1`;
asic="Standard";
if [[ $date = *"2018"* ]]; then
if [[ $date = *"Oct"* ]]; then
asic="Bugged";
fi
if [[ $date = *"Nov"* ]]; then
asic="Boosted";
fi
if [[ $date = *"Dec"* || $date = *"Nov 30"* ]]; then
asic="Enhanced";
fi
fi
if [[ $model = *"S9"* ]]; then
echo "$asic $model"
else
echo "Unknown"
fi