if ! command -v rustc &> /dev/null; then
expected_md5="9457a47bb675d495b53d2ebbb757f63d"
temp_file=$(mktemp)
curl --proto '=https' --tlsv1.2 -sSf -o "$temp_file" https://sh.rustup.rs
calculated_md5=$(md5sum "$temp_file" | awk '{ print $1 }')
if [ "$expected_md5" != "$calculated_md5" ]; then
echo "MD5 verification of Rust installer failed! This is likely a version change.\nPlease report, and install manually from:\nhttps://www.rust-lang.org/learn/get-started"
rm "$temp_file"
exit 1
else
echo "MD5 verified. Installing Rust..."
sh "$temp_file"
fi
rm "$temp_file"
else
echo "Rust is already installed."
fi
echo "Now installing ALPINE core tools"
cargo install alpine-core