From: José Martínez Date: Sun, 6 Jul 2014 20:11:41 +0000 (+0200) Subject: lxc-ubuntu: update coding style X-Git-Tag: lxc-1.1.0.alpha1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5652d61020bf11fff802fe349cddb448d2c5629d;p=thirdparty%2Flxc.git lxc-ubuntu: update coding style Signed-off-by: José Martínez Acked-by: Stéphane Graber --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index b151375a1..83c962e4f 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -47,16 +47,19 @@ if [ -r /etc/default/lxc ]; then fi # Check if given path is in a btrfs partition -is_btrfs() { +is_btrfs() +{ [ -e $1 -a $(stat -f -c '%T' $1) = "btrfs" ] } # Check if given path is the root of a btrfs subvolume -is_btrfs_subvolume() { +is_btrfs_subvolume() +{ [ -d $1 -a $(stat -f -c '%T' $1) = "btrfs" -a $(stat -c '%i' $1) -eq 256 ] } -try_mksubvolume() { +try_mksubvolume() +{ path=$1 [ -d $path ] && return 0 mkdir -p $(dirname $path) @@ -67,7 +70,8 @@ try_mksubvolume() { fi } -try_rmsubvolume() { +try_rmsubvolume() +{ path=$1 [ -d $path ] || return 0 if is_btrfs_subvolume $path; then