summaryrefslogtreecommitdiffstats
path: root/lib/container
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlib/container/auto23
-rwxr-xr-xlib/container/console2
-rwxr-xr-xlib/container/create2
-rwxr-xr-xlib/container/enter2
-rwxr-xr-xlib/container/limit2
-rwxr-xr-xlib/container/list2
-rwxr-xr-xlib/container/move2
-rwxr-xr-xlib/container/remove2
-rwxr-xr-xlib/container/restart2
-rwxr-xr-xlib/container/start2
-rwxr-xr-xlib/container/stop2
-rwxr-xr-xlib/container/version2
12 files changed, 29 insertions, 16 deletions
diff --git a/lib/container/auto b/lib/container/auto
index 969ce0a..45aa68f 100755
--- a/lib/container/auto
+++ b/lib/container/auto
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@ HOOKS="/etc/container-tools/hooks"
Parameters ()
{
- GETOPT_LONGOPTIONS="start,stop,"
- GETOPT_OPTIONS="s,t,"
+ GETOPT_LONGOPTIONS="force,start,stop,"
+ GETOPT_OPTIONS="f,s,t,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -41,6 +41,11 @@ Parameters ()
while true
do
case "${1}" in
+ -f|--force)
+ FORCE="true"
+ shift 1
+ ;;
+
-s|--start)
ACTION="start"
shift 1
@@ -66,7 +71,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -s|--start -t|--stop" >&2
+ echo "Usage: container ${COMMAND} -f|--force -s|--start -t|--stop" >&2
exit 1
}
@@ -89,13 +94,21 @@ do
done
# Run
+OPTIONS=""
+
+case "${FORCE}" in
+ true)
+ OPTIONS="${OPTIONS} -f"
+ ;;
+esac
+
for FILE in "${CONFIG}"/*.conf
do
if grep -Eqs "^ *cnt.auto=true" "${FILE}" || grep -Eqs "^ *cnt.auto=${HOST}" "${FILE}"
then
CONTAINER="$(basename ${FILE} .conf)"
- cnt ${ACTION} -n ${CONTAINER} || true
+ cnt ${ACTION} -n ${CONTAINER} ${OPTIONS} || true
fi
done
diff --git a/lib/container/console b/lib/container/console
index fbf3c2d..13bceb9 100755
--- a/lib/container/console
+++ b/lib/container/console
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/create b/lib/container/create
index 1e855ef..54cbb1d 100755
--- a/lib/container/create
+++ b/lib/container/create
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/enter b/lib/container/enter
index 4bcd5c6..dc2dd09 100755
--- a/lib/container/enter
+++ b/lib/container/enter
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/limit b/lib/container/limit
index d2a193a..b888656 100755
--- a/lib/container/limit
+++ b/lib/container/limit
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/list b/lib/container/list
index da8a158..9608fd7 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/move b/lib/container/move
index 6e855e4..78b0c7f 100755
--- a/lib/container/move
+++ b/lib/container/move
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/remove b/lib/container/remove
index eec3b02..03549a4 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/restart b/lib/container/restart
index 1c4c591..a5c2b93 100755
--- a/lib/container/restart
+++ b/lib/container/restart
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/start b/lib/container/start
index 40ee195..0009fd0 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/stop b/lib/container/stop
index e91d0c6..b8793ac 100755
--- a/lib/container/stop
+++ b/lib/container/stop
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/lib/container/version b/lib/container/version
index f72355e..89790e9 100755
--- a/lib/container/version
+++ b/lib/container/version
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by