diff options
Diffstat (limited to '')
-rwxr-xr-x | libexec/container/auto | 2 | ||||
-rwxr-xr-x | libexec/container/build | 2 | ||||
-rwxr-xr-x | libexec/container/console | 2 | ||||
-rwxr-xr-x | libexec/container/enter | 2 | ||||
-rwxr-xr-x | libexec/container/get | 2 | ||||
-rwxr-xr-x | libexec/container/info | 2 | ||||
-rwxr-xr-x | libexec/container/key | 2 | ||||
-rwxr-xr-x | libexec/container/limit | 2 | ||||
-rwxr-xr-x | libexec/container/list | 2 | ||||
-rwxr-xr-x | libexec/container/log | 2 | ||||
-rwxr-xr-x | libexec/container/move | 2 | ||||
-rwxr-xr-x | libexec/container/rebuild | 2 | ||||
-rwxr-xr-x | libexec/container/remove | 2 | ||||
-rwxr-xr-x | libexec/container/restart | 2 | ||||
-rwxr-xr-x | libexec/container/run | 2 | ||||
-rwxr-xr-x | libexec/container/start | 2 | ||||
-rwxr-xr-x | libexec/container/stop | 2 | ||||
-rwxr-xr-x | libexec/container/top | 2 | ||||
-rwxr-xr-x | libexec/container/update | 2 | ||||
-rwxr-xr-x | libexec/container/version | 71 |
20 files changed, 51 insertions, 58 deletions
diff --git a/libexec/container/auto b/libexec/container/auto index 83c5c50..c1014dc 100755 --- a/libexec/container/auto +++ b/libexec/container/auto @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/build b/libexec/container/build index 2c29730..d98d97e 100755 --- a/libexec/container/build +++ b/libexec/container/build @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/console b/libexec/container/console index be2b897..534482a 100755 --- a/libexec/container/console +++ b/libexec/container/console @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/enter b/libexec/container/enter index b366ba6..2220e5c 100755 --- a/libexec/container/enter +++ b/libexec/container/enter @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/get b/libexec/container/get index 0d0f420..f25cbae 100755 --- a/libexec/container/get +++ b/libexec/container/get @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/info b/libexec/container/info index b713e7a..7b968ae 100755 --- a/libexec/container/info +++ b/libexec/container/info @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/key b/libexec/container/key index efd214e..3a73249 100755 --- a/libexec/container/key +++ b/libexec/container/key @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/limit b/libexec/container/limit index b7f6e9b..2c9c77e 100755 --- a/libexec/container/limit +++ b/libexec/container/limit @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/list b/libexec/container/list index e211b7c..25dd7e0 100755 --- a/libexec/container/list +++ b/libexec/container/list @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/log b/libexec/container/log index b7a000d..e165cb0 100755 --- a/libexec/container/log +++ b/libexec/container/log @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/move b/libexec/container/move index fdc19e6..b11d6a9 100755 --- a/libexec/container/move +++ b/libexec/container/move @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/rebuild b/libexec/container/rebuild index e526520..0e7aa6b 100755 --- a/libexec/container/rebuild +++ b/libexec/container/rebuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/remove b/libexec/container/remove index 4cb5d48..ae6ec1f 100755 --- a/libexec/container/remove +++ b/libexec/container/remove @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/restart b/libexec/container/restart index 0eb753c..a671a40 100755 --- a/libexec/container/restart +++ b/libexec/container/restart @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/run b/libexec/container/run index 4daeaa2..7cb7758 100755 --- a/libexec/container/run +++ b/libexec/container/run @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/start b/libexec/container/start index 128c418..5891485 100755 --- a/libexec/container/start +++ b/libexec/container/start @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/stop b/libexec/container/stop index 8ca98ce..b9751a0 100755 --- a/libexec/container/stop +++ b/libexec/container/stop @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/top b/libexec/container/top index 268da9a..1d89a82 100755 --- a/libexec/container/top +++ b/libexec/container/top @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/update b/libexec/container/update index e2d9c80..74e1cb4 100755 --- a/libexec/container/update +++ b/libexec/container/update @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # diff --git a/libexec/container/version b/libexec/container/version index e567f8f..6f39418 100755 --- a/libexec/container/version +++ b/libexec/container/version @@ -1,8 +1,6 @@ -#!/usr/bin/python3 +#!/bin/sh -# Open Infrastructure: compute-tools - -# Copyright (C) 2014-2023 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # @@ -19,38 +17,33 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -from os import access, X_OK -from pathlib import Path -from subprocess import run -from sys import exit, stderr, stdout - -import compute_tools.container as container - -def main(): - # pre hooks - pre_hooks = Path('/etc/compute-tools/hooks').glob('pre-version.*') - - if pre_hooks: - # hooks exist - for hook in pre_hooks: - if access(hook, X_OK): - # hook is executable - run(str(hook), shell=True, stderr=stderr, stdout=stdout) - - # run - container.print_version() - - # post hooks - post_hooks = Path('/etc/compute-tools/hooks').glob('post-version.*') - - if post_hooks: - # hooks exist - for hook in post_hooks: - if access(hook, X_OK): - # hook is executable - run(str(hook), shell=True, stderr=stderr, stdout=stdout) - - exit(0) - -if __name__ == '__main__': - main() +set -e + +PROJECT="open-infrastructure" +SOFTWARE="compute-tools" +PROGRAM="container" +COMMAND="$(basename ${0})" + +HOOKS="/etc/${SOFTWARE}/hooks" +SHARE="/usr/share/${SOFTWARE}" + +# Pre hooks +for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}" +do + if [ -x "${FILE}" ] + then + "${FILE}" + fi +done + +# Run +cat "${SHARE}/VERSION.txt" + +# Post hooks +for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" +do + if [ -x "${FILE}" ] + then + "${FILE}" + fi +done |