Merge pull request #47 from YunoHost/check_lxc_version

[mod] refuse to run for old version of LXC
This commit is contained in:
Alexandre Aubin 2019-02-28 22:56:39 +01:00 committed by GitHub
commit f2ecdabe89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
ynh-dev
View file

@ -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."