]> git.proxmox.com Git - mirror_lxc.git/blobdiff - templates/lxc-alpine.in
Move container creation fully into the api
[mirror_lxc.git] / templates / lxc-alpine.in
index 98347ed675faaa580b44204aa90086e1068788d2..6180afd0c69362debcd2efadea29876adf012a3f 100644 (file)
@@ -150,7 +150,8 @@ die() {
 usage() {
     cat >&2 <<EOF
 Usage: $(basename $0) [-h|--help] [-r|--repository <url>] [-a|--arch <arch>]
-                   -p|--path <path> -n|--name <name> [PKG...]
+                   [--rootfs <rootfs>] -p|--path <path> -n|--name <name>
+                   [PKG...]
 EOF
 }
 
@@ -180,6 +181,11 @@ while [ $# -gt 0 ]; do
         name=$1
         shift
         ;;
+    --rootfs)
+        optarg_check $opt "$1"
+        rootfs=$1
+        shift
+        ;;
     -p|--path)
         optarg_check $opt "$1"
         path=$1
@@ -218,9 +224,11 @@ if [ -z "${path}" ]; then
     path="${default_path}/${name}"
 fi
 
-rootfs=`awk -F= '$1 ~ /^lxc.rootfs/ { print $2 }' "$path/config" 2>/dev/null`
 if [ -z "$rootfs" ]; then
-    rootfs="${path}/rootfs"
+    rootfs=`awk -F= '$1 ~ /^lxc.rootfs/ { print $2 }' "$path/config" 2>/dev/null`
+    if [ -z "$rootfs" ]; then
+        rootfs="${path}/rootfs"
+    fi
 fi
 
 lxc_arch=$arch