2018-11-11 08:02:50 -08:00
|
|
|
#!/usr/bin/env bash
|
2018-09-08 17:46:43 -07:00
|
|
|
#
|
|
|
|
# Snap daemons have no access to the environment so |snap set solana ...| is
|
|
|
|
# used to set runtime configuration.
|
|
|
|
#
|
|
|
|
# This script exports the snap runtime configuration options back as
|
|
|
|
# environment variables before invoking the specified program
|
|
|
|
#
|
|
|
|
|
|
|
|
if [[ -d $SNAP ]]; then # Running inside a Linux Snap?
|
|
|
|
RUST_LOG="$(snapctl get rust-log)"
|
|
|
|
SOLANA_METRICS_CONFIG="$(snapctl get metrics-config)"
|
|
|
|
|
|
|
|
export RUST_LOG
|
|
|
|
export SOLANA_METRICS_CONFIG
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec "$@"
|