]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Tab/spaces consistency for templates
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Nov 2013 16:57:34 +0000 (11:57 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 25 Nov 2013 16:57:34 +0000 (11:57 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-alpine.in
templates/lxc-openmandriva.in
templates/lxc-opensuse.in
templates/lxc-oracle.in
templates/lxc-sshd.in
templates/lxc-ubuntu-cloud.in

index 258eed4c58ffc1d52920061229211c25eb277a55..56236a4cc32b82cb2874707ac15eb58df6a72084 100644 (file)
@@ -300,7 +300,7 @@ while [ $# -gt 0 ]; do
         optarg_check $opt "$1"
         arch=$1
         shift
-       ;;
+        ;;
     --)
         break;;
     --*=*)
@@ -335,12 +335,17 @@ lxc_arch=$arch
 apk_arch=$arch
 
 case "$arch" in
-       i[3-6]86)
-               apk_arch=x86;;
-       x86)
-               lxc_arch=i686;;
-       x86_64|"") ;;
-       *)      die "unsupported architecture: $arch";;
+    i[3-6]86)
+        apk_arch=x86
+        ;;
+    x86)
+        lxc_arch=i686
+        ;;
+    x86_64|"")
+        ;;
+    *)
+        die "unsupported architecture: $arch"
+        ;;
 esac
 
 : ${APK:=apk}
index 70c3a21e436566bf092052ce45d4e293a608d4c4..75d310a99c1f20e8e2c121c0781d3771d8850c89 100644 (file)
@@ -181,7 +181,7 @@ install_openmandriva()
 
         echo "Checking cache download in $cache/rootfs ... "
         if [ ! -e "$cache/rootfs" ]; then
-           echo $cache/rootfs
+            echo $cache/rootfs
             create_chroot_openmandriva
             if [ $? -ne 0 ]; then
                 echo "Failed to download 'openmandriva basesystem-minimal'"
@@ -349,9 +349,9 @@ if [ -f /etc/lsb-release ]; then
     if [ "$DISTRIB_ID" = "OpenMandrivaLinux" ]; then
         release=openmandriva2013.0
     elif [ "$DISTRIB_ID" = "RosaDesktop.Fresh" ]; then
-       release=rosa2012.1
+        release=rosa2012.1
     else
-       echo "This is not an OpenMandriva or ROSA release"
+        echo "This is not an OpenMandriva or ROSA release"
         exit 1
     fi
 fi
@@ -366,7 +366,7 @@ do
         -P|--profile)   profile=$2; shift 2;;
         -c|--clean)     clean=$2; shift 2;;
         -R|--release)   release=$2; shift 2;;
-       -a|--arch)      arch=$2; shift 2;;
+        -a|--arch)      arch=$2; shift 2;;
         -4|--ipv4)      ipv4=$2; shift 2;;
         -6|--ipv6)      ipv6=$2; shift 2;;
         -g|--gw)        gw=$2; shift 2;;
index 88f7742aba7e751355083696114fd31d319953f1..f28ae22d11890a127e555b5df9f8d7ce4b6cf655 100644 (file)
@@ -246,29 +246,29 @@ copy_configuration()
     name=$3
 
     if grep -q "^lxc.network.type" $path/config; then
-       TYPE=$(sed '/^#/d; /lxc.network.type/!d; s/.*=[ \t]*//' $path/config)
-       grep -q "^lxc.network.ipv4" $path/config
-       IPV4_NOT_CONFIGURED=$?
-
-       if [ ! grep -q "^lxc.network.*.gateway" $path/config ]; then
-           [ $IPV4_NOT_CONFIGURED -eq 0 ] && IPV4=$(sed '/^#/d; /lxc.network.ipv4/!d; /gateway/d; s/.*=[ \t]*//; s/\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/' $path/config)
-           if [ "$TYPE" = "veth" -o "$TYPE" = "macvlan" ]; then
-               if [ $IPV4_NOT_CONFIGURED -eq 0 -a "$IPV4" != "0.0.0.0" ]; then
-                   # set default route
-                   IP=$(/sbin/ip route | awk '/default/ { print $3 }')
-                   echo "lxc.network.ipv4.gateway = $IP " >> $path/config
-               else
-                   # set network as dhcp
-                   sed -i -e 's/BOOTPROTO=.*/BOOTPROTO=dhcp/' $rootfs/etc/sysconfig/network/ifcfg-eth0
-               fi
-           fi
-       fi
-       if [ "$TYPE" != "empty" ]; then
-           echo "#remove next line if host DNS configuration should not be available to container" >> $path/config
-           echo "lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro 0 0" >> $path/config
-       fi
+        TYPE=$(sed '/^#/d; /lxc.network.type/!d; s/.*=[ \t]*//' $path/config)
+        grep -q "^lxc.network.ipv4" $path/config
+        IPV4_NOT_CONFIGURED=$?
+
+        if [ ! grep -q "^lxc.network.*.gateway" $path/config ]; then
+            [ $IPV4_NOT_CONFIGURED -eq 0 ] && IPV4=$(sed '/^#/d; /lxc.network.ipv4/!d; /gateway/d; s/.*=[ \t]*//; s/\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*/\1/' $path/config)
+            if [ "$TYPE" = "veth" -o "$TYPE" = "macvlan" ]; then
+                if [ $IPV4_NOT_CONFIGURED -eq 0 -a "$IPV4" != "0.0.0.0" ]; then
+                    # set default route
+                    IP=$(/sbin/ip route | awk '/default/ { print $3 }')
+                    echo "lxc.network.ipv4.gateway = $IP " >> $path/config
+                else
+                    # set network as dhcp
+                    sed -i -e 's/BOOTPROTO=.*/BOOTPROTO=dhcp/' $rootfs/etc/sysconfig/network/ifcfg-eth0
+                fi
+            fi
+        fi
+        if [ "$TYPE" != "empty" ]; then
+            echo "#remove next line if host DNS configuration should not be available to container" >> $path/config
+            echo "lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind,ro 0 0" >> $path/config
+        fi
     else
-       echo 'lxc.network.type = empty' >> $path/config
+        echo 'lxc.network.type = empty' >> $path/config
     fi
 
     grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
index 8770e70da17fd9f7240f8bfef265379dc42d3018..0552aabf1e8aaf298a4399ac3af7533a8ac0aa59 100644 (file)
@@ -67,7 +67,7 @@ container_rootfs_configure()
     if [ -e $container_rootfs/etc/selinux/config ]; then
         sed -i 's|SELINUX=enforcing|SELINUX=disabled|' $container_rootfs/etc/selinux/config
     else
-       mkdir -p $container_rootfs/etc/selinux
+        mkdir -p $container_rootfs/etc/selinux
         echo "SELINUX=disabled" >$container_rootfs/etc/selinux/config
     fi
     sed -i 's|session[ \t]*required[ \t]*pam_selinux.so[ \t]*close|#session required pam_selinux.so close|' $container_rootfs/etc/pam.d/login
index 622f8220b3d1ea5b5eba81a1c56178e92a53eb1c..b8df78f07622fb3c1dd18eaf568441e7fc09717a 100644 (file)
@@ -220,7 +220,7 @@ send host-name "<hostname>";
 EOF
         ifconfig eth0 up
         dhclient eth0 -cf /dhclient.conf
-       echo "Container IP address:"
+        echo "Container IP address:"
         ifconfig eth0 |grep inet
     fi
 
index 09c6626273ad8515706dffd670b0c99983b8419e..3042d89a78f01b57b6cdac88e10af252696102a9 100644 (file)
@@ -404,9 +404,9 @@ copy_configuration $path $rootfs $name $arch $release
 "$CLONE_HOOK_FN" "${cloneargs[@]}" "$rootfs"
 
 if [ $mapped_uid -ne -1 ]; then
-       chown $mapped_uid $path/config
-       chown -R $mapped_uid $STATE_DIR
-       chown -R $mapped_uid $cache
+    chown $mapped_uid $path/config
+    chown -R $mapped_uid $STATE_DIR
+    chown -R $mapped_uid $cache
 fi
 
 echo "Container $name created."