Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo " You may use, edit and share if you like to, but credit the original creator"
- echo "when you share and/or edit this script."
- echo ""
- echo "WARNING!: By no means, is the script creator liable for any damage"
- echo "this script creates, either softwarematic or otherwise."
- echo "Use it at your own risk!"
- echo ""
- sleep 3
- echo "This script will create a Virtual Harddisk (vdi) in the current"
- echo "or provided directory"
- echo "Please, put in the amount of TiB you want to use in the X.XX format"
- echo "Example: 2.32 or 4.00"
- echo ""
- echo "[Press ENTER to confirm after input]"
- read -r tsize
- echo ""
- echo "How do you like to name the Harddisk? You can put in a location as well."
- echo "Example: HDD.vdi or /home/$USER/My Folder/HDD.vdi"
- echo 'WARNING!: Writing locations like "~/" will not work!'
- echo ""
- echo "[Press ENTER to confirm after input]"
- read -r vdi
- echo ""
- msize=$(echo "$tsize" \* 1048576 | bc)
- rsize=${msize::-3}
- echo "The $vdi virtual disk with a size of $tsize TiB, or $rsize MiB"
- echo "will be created. Do you want to proceed?"
- echo ""
- select pc in "Proceed" "Cancel"; do
- case $pc in
- Proceed ) VBoxManage createhd --filename "$vdi" --size "$rsize" --variant Standard; echo ""; break;;
- Cancel ) break;;
- esac
- done
- echo "This script was written by Erwin Oldebesten on 14/06/2017"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement