Merge pull request #16 from crushmaster/master

Added the possibilty to pass a block device to the script as first arg...
This commit is contained in:
Marco Ochse 2015-03-24 11:41:00 +01:00
commit a063925c36

View file

@ -13,6 +13,7 @@ myUBUNTUISO="ubuntu-14.04.2-server-amd64.iso"
myTPOTCEISO="tpotce.iso" myTPOTCEISO="tpotce.iso"
myTPOTCEDIR="tpotceiso" myTPOTCEDIR="tpotceiso"
myTMP="tmp" myTMP="tmp"
myDEV=$1
# Let's create a function for colorful output # Let's create a function for colorful output
fuECHO () { fuECHO () {
@ -65,9 +66,18 @@ isohybrid $myTPOTCEISO
fuECHO "### Cleaning up." fuECHO "### Cleaning up."
rm -rf $myTMP $myTPOTCEDIR rm -rf $myTMP $myTPOTCEDIR
# Done. # Let's write the image to $myDEV or show instructions
if [ -b $myDEV ] && [ ! -z $1 ]
then
fuECHO "### Found a block device on $myDEV"
fuECHO "### Writing image to device. Please wait..."
dd bs=1M if="$myTPOTCEISO" of="$myDEV"
else
fuECHO "### Install to usb stick"
fuECHO "###### Show devices: df or fdisk -l"
fuECHO "###### Write to device: dd bs=1M if="$myTPOTCEISO" of=<path to device>"
fi
# Done
fuECHO "### Done." fuECHO "### Done."
fuECHO "### Install to usb stick"
fuECHO "###### Show devices: df or fdisk -l"
fuECHO "###### Write to device: dd bs=1M if="$myTPOTCEISO" of=<path to device>"
exit 0 exit 0