7 if [ ! `whoami` = "root" ] ; then
9 echo "You need to be root to run this shell script"
13 usb=`blkid |grep bs-rescue|cut -d: -f1`
15 echo "Please make sure that only one casper-rw exists on the system"
16 echo "if you have other disks labeled casper-rw, unplug them now"
18 echo "and make sure your USB key is mounted"
20 echo "This will install bacula-rescue on " ${USB_DEV}
22 echo "Continue?? (y/n)"
24 if [ ! "$a" = "y" ];then
29 if [ x{$USB_DEV} = x{} ];then
30 echo "You must mount your USB key before running this script"
37 dir=`df |grep ${USB_DEV}1 |awk '{print $NF}'`
39 umount ${USB_DEV}1 >/dev/null 2>&1
40 echo "We're about to erase the content of ${USB_DEV}1 , continue ? (y/n)"
42 if [ ! "$a" = "y" ];then
45 echo "These are large files, so it will take some time ..."
48 gunzip <files/rescue.gz | dd bs=1M of=${USB_DEV}1
51 echo "Copy of boot setup failed. USB key creation failed!!!"
56 dir=`df |grep ${USB_DEV}2 |awk '{print $NF}'`
58 if [ $dir = "/" ] ;then
59 echo "Oops we were about to scrap your system , was the USB key mounted ??, guess not...."
64 echo "We're about to erase the content of $dir , continue ? (y/n)"
66 if [ ! "$a" = "y" ];then
70 tar -xvzf $cwd/files/rw.tar.gz
72 dir=`df |grep ${USB_DEV}3 |awk '{print $NF}'`
73 if [ $dir = "/" ] ;then
74 echo "Oops we were about to scrap your system , was the USB key mounted ??, guess not...."
78 echo "We're about to erase the content of $dir , continue ? (y/n)"
80 if [ ! "$a" = "y" ];then
83 cp -r files/bacula-rescue $dir