diff options
Diffstat (limited to 'bin/container')
-rwxr-xr-x | bin/container | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/container b/bin/container index 50e5379..5df0fff 100755 --- a/bin/container +++ b/bin/container @@ -1,6 +1,5 @@ #!/bin/sh -# container-tools - Manage systemd-nspawn containers # Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ @@ -20,10 +19,10 @@ set -e -SOFTWARE="container-tools" +PROJECT="open-infrastructure" PROGRAM="container" -HOOKS="/etc/${SOFTWARE}/hooks" +HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks" # Parameter PARAMETER="${1}" @@ -44,7 +43,7 @@ OPTIONS="${@}" for COMMAND in $(echo ${COMMANDS} | sed -e 's|,| |g') do - if [ ! -e "/usr/lib/${SOFTWARE}/${PROGRAM}/${COMMAND}" ] + if [ ! -e "/usr/lib/${PROJECT}/${PROGRAM}/${COMMAND}" ] then echo "'${COMMAND}': no such ${PROGRAM} command" >&2 exit 1 @@ -71,12 +70,12 @@ do HOST="$(hostname -f)" # logfile - echo "${DATE} ${HOST} ${USER} ${PROGRAM} ${COMMAND} ${OPTIONS}" >> "/var/log/${SOFTWARE}/${PROGRAM}.log" + echo "${DATE} ${HOST} ${USER} ${PROGRAM} ${COMMAND} ${OPTIONS}" >> "/var/log/${PROJECT}/${PROGRAM}.log" # irc - if [ -e /usr/bin/irk ] && [ -e "/etc/default/${SOFTWARE}" ] + if [ -e /usr/bin/irk ] && [ -e "/etc/${PROJECT}/${PROGRAM}.conf" ] then - . /etc/default/${SOFTWARE} + . "/etc/${PROJECT}/${PROGRAM}.conf" if [ -n "${IRK_TARGETS}" ] then @@ -91,7 +90,7 @@ do fi # Run - "/usr/lib/${SOFTWARE}/${PROGRAM}/${COMMAND}" "${OPTIONS}" + "/usr/lib/${PROJECT}/${PROGRAM}/${COMMAND}" "${OPTIONS}" # Post hooks for FILE in "${HOOKS}/post-${PROGRAM}".* "${HOOKS}/${NAME}.post-${PROGRAM}" |