citadel-core/scripts/app
2022-03-19 15:29:51 +00:00

27 lines
998 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
#
# SPDX-License-Identifier: GPL-3.0-or-later
NODE_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
# If the first argument is stop, start, install or uninstall, and there are multiple other arguments,
# Run the "${NODE_ROOT}/app/app-manager.py" for each of the other arguments.
# Otherwise, run the "${NODE_ROOT}/app/app-manager.py" with the first argument as the command.
if [ "$1" == "stop" ] || [ "$1" == "start" ] || [ "$1" == "install" ] || [ "$1" == "uninstall" ]; then
for app in "${@:2}"; do
"${NODE_ROOT}/app/app-manager.py" "$1" "$app"
done
elif [ "$1" == "update" ]; then
for app in "${@:2}"; do
"${NODE_ROOT}/app/app-manager.py" --invoked-by-configure update "$app"
done
"${NODE_ROOT}/app/app-manager.py" generate
for app in "${@:2}"; do
"${NODE_ROOT}/app/app-manager.py" start "$app"
done
else
"${NODE_ROOT}/app/app-manager.py" "$@"
fi