#!/bin/bash # chkconfig: 345 20 80 # description: Create BTRFS subvolumes for LXC reference images. # case "$1" in start|restart|reload) ;; force) FORCE=true;; stop|status) exit 0 ;; *) echo $"Usage: $0 {start|stop|restart|reload|status|force}" exit 1 ;; esac # Check if we are in the build environment mount | grep 'planetlab-vservers' > /dev/null RETVAL=$? [ $RETVAL -ne 0 ] && exit 0 # Source function library . /etc/init.d/functions VERSION=`yum info lxc-reference | grep Version | awk '{ print $3; }'` if [ -f /vservers/lxc-reference-${VERSION}.tgz ]; then mkdir -p /vservers/.lvref btrfs subvolume create /vservers/.lvref/lxc-f14-x86_64 btrfs subvolume create /vservers/.lvref/lxc-squeeze-x86_64 tar zxf /vservers/lxc-reference-${VERSION}.tgz -C /vservers/ rm -rf /vservers/lxc-reference-${VERSION}.tgz fi exit 0