diff options
Diffstat (limited to 'main/lxc/lxc.initd')
-rw-r--r-- | main/lxc/lxc.initd | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/main/lxc/lxc.initd b/main/lxc/lxc.initd index a77ba0e86..cfa90c869 100644 --- a/main/lxc/lxc.initd +++ b/main/lxc/lxc.initd @@ -13,16 +13,19 @@ depend() { } lxc_get_configfile() { - if [ -f "/etc/lxc/${CONTAINER}.conf" ]; then - echo "/etc/lxc/${CONTAINER}.conf" - elif [ -f "/etc/lxc/${CONTAINER}/config" ]; then - echo "/etc/lxc/${CONTAINER}/config" - else - eerror "Unable to find a suitable configuration file." - eerror "If you set up the container in a non-standard" - eerror "location, please set the CONFIGFILE variable." - return 1 - fi + local i + for i in /var/lib/lxc/${CONTAINER}/config \ + /etc/lxc/${CONTAINER}.conf \ + /etc/lxc/${CONTAINER}/config; do + if [ -f "$i" ]; then + echo "$i" + return 0 + fi + done + eerror "Unable to find a suitable configuration file." + eerror "If you set up the container in a non-standard" + eerror "location, please set the CONFIGFILE variable." + return 1 } lxc_get_var() { |