]> git.sur5r.net Git - bacula/rescue/blobdiff - rescue/linux/usb/src/scripts/restore/part
Add new usb rescue key code
[bacula/rescue] / rescue / linux / usb / src / scripts / restore / part
diff --git a/rescue/linux/usb/src/scripts/restore/part b/rescue/linux/usb/src/scripts/restore/part
new file mode 100644 (file)
index 0000000..9d4397d
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+                       if [ -f formatscript ]; then
+                       rm formatscript
+                       fi
+cat >formatscript <<END_OF_DATA
+
+#
+#  Format all partitions on disk $disk -- created by getdiskinfo
+#
+echo ""
+echo "This script will format all partitions on disk $disk."
+echo ""
+echo "IT WILL DESTROY ALL DATA ON DISK $disk !!!!"
+echo ""
+if [ ! -f noprompt ];then
+echo -n "Are you sure you want to continue? yes/no: "
+read a
+if [ x\$a != xyes ] ; then
+   exit 1
+fi 
+fi
+if [ ! -f badblocksnoprompt ];then
+echo "Do you want to do a disk check for bad blocks?"
+echo -n "It is recommended, but takes time. yes/no: "
+read a
+if [ x\$a = xyes ] ; then
+  check="-c"
+else
+   check=
+fi
+fi
+END_OF_DATA
+
+
+       
+
+               dis=${disk%?}
+
+
+               formatscripto=`ls working/scripts |grep $dis|grep format`
+               
+                       cat working/scripts/$formatscripto |grep $disk|while read line;do
+                       echo $line >>formatscript
+
+                       done
+               grep mk formatscript>>/dev/null 2>&1
+               if [ $? = 0 ];then
+               cat formatscript>>formatallscript
+               fi
+               rm formatscript