citadel-core/scripts/app
2022-03-17 09:43:59 +01:00

19 lines
710 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
else
"${NODE_ROOT}/app/app-manager.py" "$@"
fi