From 9c257ffef25f49b1ca6ac4b0eea325eecbec52c8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 4 Jan 2017 11:41:50 +0100 Subject: Adding upstream version 20170101. Signed-off-by: Daniel Baumann --- lib/container/auto | 23 ++++++++++++++++++----- lib/container/console | 2 +- lib/container/create | 2 +- lib/container/enter | 2 +- lib/container/limit | 2 +- lib/container/list | 2 +- lib/container/move | 2 +- lib/container/remove | 2 +- lib/container/restart | 2 +- lib/container/start | 2 +- lib/container/stop | 2 +- lib/container/version | 2 +- 12 files changed, 29 insertions(+), 16 deletions(-) (limited to 'lib') 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 +# Copyright (C) 2014-2017 Daniel Baumann # # 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 -- cgit v1.2.3