new: [zato] Add actions to start, stop and restart Zato
This commit is contained in:
25
zato/actions/restart-zato
Executable file
25
zato/actions/restart-zato
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [ -z "$SERVICE_DATASTORE" ]; then
|
||||
echo "This script is meant to be run through 'compose' to work properly." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. "$CHARM_PATH/lib/common"
|
||||
|
||||
# Combined commands to be run as zato user
|
||||
local zato_commands="
|
||||
/opt/zato/current/bin/zato stop /opt/zato/env/qs-1/server1/ &&
|
||||
cd /opt/zato/env/qs-1 &&
|
||||
./start-server-fg.sh &
|
||||
"
|
||||
|
||||
# Execute commands as zato user
|
||||
if ! exec_as_zato_in_container "$zato_commands"; then
|
||||
printf "Error: Failed to execute zato commands in container '%s'.\n" "$CONTAINER_NAME" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
printf "Zato restarted successfully in container '%s'.\n" "$CONTAINER_NAME" >&2
|
||||
|
Reference in New Issue
Block a user