#!/bin/sh
#
# Create bootstrap information files -- prelude to creating a
-# Bacula Rescue Disk
+# Bacula Rescue data for USB key
#
# Kern Sibbald, December MMII
-# This source distributed under the GPL
+# This source distributed under the GPLv2
#
export LANG=C
cwd=`pwd`
-host=`uname -s`
-di=${cwd}/diskinfo
-scr=${cwd}/scripts
+os=`uname -s`
+if [ ! "x$1" = "x" ] ; then
+ host=$1
+else
+ host=`hostname`
+fi
+echo "Host specific data will be saved in the directory: ${host}"
+echo " "
+mkdir -p $host
+di=${cwd}/$host/diskinfo
+scr=${cwd}/$host/scripts
-case $host in
+case $os in
Linux)
;;
FreeBSD | SunOS | IRIX)
;;
*)
echo ""
- echo "Unknown operating system type: $host"
+ echo "Unknown operating system type: $os"
exit 1
;;
esac
if [ ! `whoami` = "root" ] ; then
echo ""
- echo "You need to be root to run this, otherwise"
- echo "sfdisk produces no output. Continuing anyway ..."
+ echo "You need to be root to run this script ..."
echo ""
+ exit 1
fi
#
cp /etc/fstab fstab.bsi
cp /etc/mtab mtab.bsi
df -Tl >df.bsi
-sfdisk -s >sfdisk.disks.bsi
+# Pickup all disks except USB_DEV
+sfdisk -s | grep -v "${USB_DEV}" >sfdisk.disks.bsi
grep "^/dev/" sfdisk.disks.bsi | sed -n 's%\(^/dev/[A-Za-z]*\):.*$%\1%p' >disks.bsi
for i in `cat disks.bsi`; do
j=`echo $i | cut -c6-`