Skip to content

Instantly share code, notes, and snippets.

@plavjanik
Last active March 29, 2022 00:24
Show Gist options
  • Select an option

  • Save plavjanik/3d38662a18f4651cba8f8fb0231daf91 to your computer and use it in GitHub Desktop.

Select an option

Save plavjanik/3d38662a18f4651cba8f8fb0231daf91 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
echo "Called with: $@" > zowe-init.log
if [[ "$1" == "zowe-init" || "$1" == "cat" ]]; then
# Start the gnome keyring daemon when a bash session is initialized (requires passing `--privileged` or `--cap-add ipc_lock` when calling `docker run`):
[ -z "$GNOME_KEYRING_CONTROL" ] && RND=$(openssl rand -base64 32) && eval $(echo "$RND" | gnome-keyring-daemon --unlock --components=secrets >> zowe-init.log | sed -e "s/^/export /g")
# Calling Zowe CLI to initialize daemon mode:
zowe --version >> zowe-init.log
cat # Prevents terminating the container on the `docker run` command
else
exec "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment