diff --git a/ynh-dev b/ynh-dev index d3a4018..7331334 100755 --- a/ynh-dev +++ b/ynh-dev @@ -30,6 +30,8 @@ function main() [ -z "$ACTION" ] && show_usage && exit 0 + check_lxc_version + case "${ACTION}" in help|-h|--help) show_usage $ARGUMENTS ;; @@ -111,6 +113,17 @@ function create_sym_link() { # Actions # ################################################################## +function check_lxc_version() +{ + local LXC_VERSION=$(lxc-info --version) + + if [ "${${LXC_VERSION}:0:1}" != 3 ] + then + echo "ERROR: you need at least version 3 of LXC otherwise the box won't work" + exit 1 + fi +} + function start_ynhdev() { [[ $(systemctl is-active lxc-net) == "active" ]] || critical "Service lxc-net should be running ... You probably need to fix your lxc network conf before being able to use lxc's."