From: Guilhem Lettron Date: Thu, 14 Nov 2013 09:55:28 +0000 (+0100) Subject: lxc-ubuntu: Factorize @LOCALSTATEDIR@ variable X-Git-Tag: lxc-1.0.0.beta1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=703d065d5285fc744bf4f902d002f90387544de5;p=thirdparty%2Flxc.git lxc-ubuntu: Factorize @LOCALSTATEDIR@ variable Signed-off-by: Guilhem Lettron Acked-by: Stéphane Graber --- diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 68958268a..6d43fcc46 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -26,6 +26,8 @@ set -e +LOCALSTATEDIR=@LOCALSTATEDIR@ + if [ -r /etc/default/lxc ]; then . /etc/default/lxc fi @@ -92,7 +94,7 @@ EOF fi # generate new SSH keys - if [ -x $rootfs@LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst ]; then + if [ -x $rootfs$LOCALSTATEDIR/lib/dpkg/info/openssh-server.postinst ]; then cat > $rootfs/usr/sbin/policy-rc.d << EOF #!/bin/sh exit 101 @@ -101,7 +103,7 @@ EOF rm -f $rootfs/etc/ssh/ssh_host_*key* mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled - DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs @LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst configure + DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs $LOCALSTATEDIR/lib/dpkg/info/openssh-server.postinst configure mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf rm -f $rootfs/usr/sbin/policy-rc.d @@ -329,8 +331,8 @@ install_ubuntu() rootfs=$1 release=$2 flushcache=$3 - cache="@LOCALSTATEDIR@/cache/lxc/$release" - mkdir -p @LOCALSTATEDIR@/lock/subsys/ + cache="$LOCALSTATEDIR/cache/lxc/$release" + mkdir -p $LOCALSTATEDIR/lock/subsys/ ( flock -x 200 @@ -364,7 +366,7 @@ install_ubuntu() return 0 - ) 200>@LOCALSTATEDIR@/lock/subsys/lxc-ubuntu + ) 200>$LOCALSTATEDIR/lock/subsys/lxc-ubuntu return $? }