mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-03-14 02:40:14 +00:00
fix rootless entrypoint - clarify and append jsonrpc
- rework statemant to be more clear
- append check of json-rpc mode to rootless part
This commit is contained in:
parent
1be5684ae3
commit
f27a3c5206
@ -3,11 +3,26 @@
|
||||
set -x
|
||||
set -e
|
||||
|
||||
[ -d /etc/docker ] && echo "$FILE is a directory."
|
||||
|
||||
[ -z "${SIGNAL_CLI_CONFIG_DIR}" ] && echo "SIGNAL_CLI_CONFIG_DIR environmental variable needs to be set! Aborting!" && exit 1;
|
||||
|
||||
["${UID}" = "${SIGNAL_CLI_UID}" && "${GID}" = "${SIGNAL_CLI_GID}"] &&\
|
||||
echo "UID and GID are already correct. Trying to start Signal Api" &&\
|
||||
if [ "$(id -u)" -eq "${SIGNAL_CLI_UID}" ] && [ "$(id -g)" -eq "${SIGNAL_CLI_GID}" ]]
|
||||
then
|
||||
echo "UID and GID are already correct. Trying to start Signal Api"
|
||||
|
||||
# TODO: check mode
|
||||
if [ "$MODE" = "json-rpc" ]
|
||||
then
|
||||
/usr/bin/jsonrpc2-helper
|
||||
if [ -n "$JAVA_OPTS" ] ; then
|
||||
echo "export JAVA_OPTS='$JAVA_OPTS'" >> /etc/default/supervisor
|
||||
fi
|
||||
service supervisor start
|
||||
supervisorctl start all
|
||||
fi
|
||||
signal-cli-rest-api -signal-cli-config=${SIGNAL_CLI_CONFIG_DIR};
|
||||
fi
|
||||
|
||||
usermod -u ${SIGNAL_CLI_UID} signal-api
|
||||
groupmod -g ${SIGNAL_CLI_GID} signal-api
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user