4
# lxc: linux Container library
7
# Daniel Lezcano <daniel.lezcano@free.fr>
9
# This library is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU Lesser General Public
11
# License as published by the Free Software Foundation; either
12
# version 2.1 of the License, or (at your option) any later version.
14
# This library is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
# Lesser General Public License for more details.
19
# You should have received a copy of the GNU Lesser General Public
20
# License along with this library; if not, write to the Free Software
21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
# This script allows to set or remove the capabilities on the lxc tools.
25
# When the capabilities are set, a non root user can manage the containers.
29
echo "usage: $0 -n <name>"
32
if [ "$(id -u)" != "0" ]; then
33
echo "This command has to be run as root"
41
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
67
if [ -z "$lxc_name" ]; then
68
echo "no container name specified"
73
if [ ! -d "$lxc_path/$lxc_name" ]; then
74
echo "'$lxc_name' does not exist"
78
# recursively remove the container to remove old container configuration
79
rm -rf --preserve-root $lxc_path/$lxc_name