]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/usb/src/scripts/restore/part
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / part
1 #!/bin/sh
2                         if [ -f formatscript ]; then
3                         rm formatscript
4                         fi
5 cat >formatscript <<END_OF_DATA
6
7 #
8 #  Format all partitions on disk $disk -- created by getdiskinfo
9 #
10 echo ""
11 echo "This script will format all partitions on disk $disk."
12 echo ""
13 echo "IT WILL DESTROY ALL DATA ON DISK $disk !!!!"
14 echo ""
15 if [ ! -f noprompt ];then
16 echo -n "Are you sure you want to continue? yes/no: "
17 read a
18 if [ x\$a != xyes ] ; then
19    exit 1
20 fi 
21 fi
22 if [ ! -f badblocksnoprompt ];then
23 echo "Do you want to do a disk check for bad blocks?"
24 echo -n "It is recommended, but takes time. yes/no: "
25 read a
26 if [ x\$a = xyes ] ; then
27   check="-c"
28 else
29    check=
30 fi
31 fi
32 END_OF_DATA
33
34
35         
36
37                 dis=${disk%?}
38
39
40                 formatscripto=`ls working/scripts |grep $dis|grep format`
41                 
42                         cat working/scripts/$formatscripto |grep $disk|while read line;do
43                         echo $line >>formatscript
44
45                         done
46                 grep mk formatscript>>/dev/null 2>&1
47                 if [ $? = 0 ];then
48                 cat formatscript>>formatallscript
49                 fi
50                 rm formatscript