Есть скрипт, который скачивает файл, если его нету в папке, а если есть то выполняет команду... Как добавить проверку sha256sum??
function hammerhead-M4B30Z {
M4B30Z="hammerhead-m4b30z-factory-625c027b.zip"
if [ -f "$M4B30Z" ]; then
# Extract
show_info 'Extraction Factory Images...'
unzip hammerhead-m4b30z*.zip
# Install
show_info 'Install Factory Images...'
cd hammerhead-m4b30z
./flash-all.sh
# Timeout
sleep 5
# Back
cd -
# Cleanup and finish
rm -rf hammerhead-m4b30z*
# Done
show_success 'Done.'
whiptail --title "Finished" --msgbox "Installation complete." 8 78
images
else
# Download
show_info 'Download Factory Images...'
wget https://dl.google.com/dl/android/aosp/hammerhead-m4b30z-factory-625c027b.zip
# Extract
show_info 'Extraction Factory Images...'
unzip hammerhead-m4b30z*.zip
# Install
show_info 'Install Factory Images...'
cd hammerhead-m4b30z
./flash-all.sh
# Timeout
sleep 5
# Back
cd -
# Cleanup and finish
rm -rf hammerhead-m4b30z*
# Done
show_success 'Done.'
whiptail --title "Finished" --msgbox "Installation complete." 8 78
images
fi
}