mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
Merge pull request #47 from YunoHost/check_lxc_version
[mod] refuse to run for old version of LXC
This commit is contained in:
commit
f2ecdabe89
1 changed files with 13 additions and 0 deletions
13
ynh-dev
13
ynh-dev
|
@ -30,6 +30,8 @@ function main()
|
||||||
|
|
||||||
[ -z "$ACTION" ] && show_usage && exit 0
|
[ -z "$ACTION" ] && show_usage && exit 0
|
||||||
|
|
||||||
|
check_lxc_version
|
||||||
|
|
||||||
case "${ACTION}" in
|
case "${ACTION}" in
|
||||||
|
|
||||||
help|-h|--help) show_usage $ARGUMENTS ;;
|
help|-h|--help) show_usage $ARGUMENTS ;;
|
||||||
|
@ -111,6 +113,17 @@ function create_sym_link() {
|
||||||
# Actions #
|
# 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()
|
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."
|
[[ $(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."
|
||||||
|
|
Loading…
Add table
Reference in a new issue