mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Implement ynh_lxc_is_stopped
This commit is contained in:
parent
9637d647af
commit
814f41f62b
1 changed files with 22 additions and 0 deletions
22
lib/ynh_lxd
22
lib/ynh_lxd
|
@ -68,6 +68,28 @@ ynh_lxc_is_started () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if an LXC container is stopped
|
||||||
|
#
|
||||||
|
# usage: ynh_lxc_is_stopped --name=name
|
||||||
|
# | arg: -n, --name= - name of the LXC
|
||||||
|
#
|
||||||
|
# Requires YunoHost version *.*.* or higher.
|
||||||
|
ynh_lxc_is_stopped () {
|
||||||
|
# Declare an array to define the options of this helper.
|
||||||
|
local legacy_args=n
|
||||||
|
local -A args_array=([n]=name=)
|
||||||
|
local name
|
||||||
|
# Manage arguments with getopts
|
||||||
|
ynh_handle_getopts_args "$@"
|
||||||
|
|
||||||
|
if [ "$(ynh_lxc_status --name=$name)" == Stopped ]
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Stopping an LXC container
|
# Stopping an LXC container
|
||||||
#
|
#
|
||||||
# usage: ynh_lxc_stop --name=name
|
# usage: ynh_lxc_stop --name=name
|
||||||
|
|
Loading…
Add table
Reference in a new issue