diff options
Diffstat (limited to 'libexec')
-rwxr-xr-x | libexec/container/version | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/libexec/container/version b/libexec/container/version index 3b33a4d..3cb0df8 100755 --- a/libexec/container/version +++ b/libexec/container/version @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/python3 # Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net> # @@ -17,33 +17,36 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -set -e +from sys import exit -PROJECT="open-infrastructure" -SOFTWARE="compute-tools" -PROGRAM="container" -COMMAND="$(basename ${0})" +import compute_tools.container as container -HOOKS="/etc/${SOFTWARE}/hooks" -SHARE="/usr/share/${SOFTWARE}" +def main(): + # run + container.print_version() + + exit(0) + +if __name__ == '__main__': + main() -# 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" + + +# Pre hooks +#for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}" +#do +# if [ -x "${FILE}" ] +# then +# "${FILE}" +# fi +#done # Post hooks -for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" -do - if [ -x "${FILE}" ] - then - "${FILE}" - fi -done +#for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" +#do +# if [ -x "${FILE}" ] +# then +# "${FILE}" +# fi +#done |