2021-10-22 15:22:10 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-01-28 06:52:26 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
2021-10-22 15:22:10 +00:00
|
|
|
#
|
2022-01-21 20:37:48 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2021-10-22 15:22:10 +00:00
|
|
|
|
|
|
|
NODE_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
|
|
|
|
|
2022-03-20 08:02:30 +00:00
|
|
|
# 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
|