]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ubuntu: Factorize @LOCALSTATEDIR@ variable
authorGuilhem Lettron <guilhem.lettron@optiflows.com>
Thu, 14 Nov 2013 09:55:28 +0000 (10:55 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Nov 2013 16:29:55 +0000 (11:29 -0500)
Signed-off-by: Guilhem Lettron <guilhem.lettron@optiflows.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-ubuntu.in

index 68958268a45ee43e489f60edbcbcd761c044ca77..6d43fcc462d574c4411c616d4b9966bec3e28561 100644 (file)
@@ -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 $?
 }