#!/bin/bash hd=$1 part=$2 pathx=/mnt/x grubfile=grub.cfg pmagicfile=pmagic.cfg conffile=configfile.cfg grubpath=$pathx/boot/grub url1=http://www.solmu.org/pub/iso/pmagic/grub/grub.cfg.txt url2=http://www.solmu.org/pub/iso/pmagic/grub/pmagic.cfg.txt url3=http://www.solmu.org/pub/iso/pmagic/grub/configfile.cfg.txt if [ -z "$hd" ];then echo echo Usage: ./`basename $0` [sdx] [part] eg. sda 5 echo exit fi mkdir -p $pathx mount /dev/${hd}${part} $pathx grub-install --force --no-floppy --root-directory=$pathx /dev/${hd} wget -O $grubpath/$grubfile $url1 wget -O $grubpath/$pmagicfile $url2 wget -O $grubpath/$conffile $url3 nano $grubpath/$grubfile nano $grubpath/$pmagicfile nano $grubpath/$conffile echo echo Download also Parted Magic? echo echo Press [ENTER] to continue \(or Cancel + C\) read pathiso=$pathx/boot/iso urliso=http://www.solmu.org/pub/iso/pmagic/pmagic-6.7.iso mkdir -p $pathiso wget -O $pathiso/pmagic-6.7.iso $urliso sleep 1 umount $pathx echo echo echo Reboot machine? echo read reboot