3 # This script creates a bundle storage of a given size.
6 # $2 = size of the container in MB
11 echo " $0 <container file> <size in MB>"
19 CONTAINER=$(cd "$(dirname "$1")"; pwd)/$(basename $1)
22 # check if the container already exists
23 if [ -f $CONTAINER ]; then
24 echo "Aborted! The specified container already exists."
28 # create the container
29 echo -n "creating the container file..."
30 /bin/dd if=/dev/zero of=$CONTAINER bs=1M count=$SIZE >/dev/null 2>/dev/null
34 echo -n "initializing ext3 filesystem for the container..."
35 /usr/sbin/mkfs.ext3 -q -F $CONTAINER > /dev/null
39 echo "The container is now ready. To use it with IBR-DTN set the container with:"
40 echo "# uci set ibrdtn.storage.container=$CONTAINER"
41 echo "# uci set ibrdtn.storage.container_size=$SIZE"