From 29fe543d0558ef6ab485176e167643ce390c5a7e Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 28 Feb 2019 22:52:57 +0100 Subject: [PATCH] [mod] refuse to run for old version of LXC --- ynh-dev | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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."