Skip to content

Instantly share code, notes, and snippets.

@WaaromZoMoeilijk
Last active May 2, 2016 18:49
Show Gist options
  • Save WaaromZoMoeilijk/806267f4d953b3a487c1811fd7e25367 to your computer and use it in GitHub Desktop.
Save WaaromZoMoeilijk/806267f4d953b3a487c1811fd7e25367 to your computer and use it in GitHub Desktop.
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "yes" == $(ask_yes_or_no "Do you have an external Harddisk plugged in? (Recommended, SSD, powered external drive) ALL DATA WILL BE LOST AFTER THE FORMAT") ]]
then
echo
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "yes" == $(ask_yes_or_no "Is the harddisk bigger then 2TB?") ]]
then
wget -q https://github.com/ezraholm50/BerryCloud/raw/master/gpt_usb.sh -P /var/scripts/
bash /var/scripts/gpt_usb.sh
else
wget -q https://github.com/ezraholm50/BerryCloud/raw/master/external_usb.sh -P /var/scripts/
bash /var/scripts/external_usb.sh
fi
else
sleep 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment