Skip to content

Commit

Permalink
use tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-shashank committed Jun 6, 2024
1 parent 01dff19 commit d35d5ba
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ansible/archival-snapshots/resources/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
# Read the ADMIN_TOKEN from the file
ADMIN_TOKEN=$(cat admin_token)

# Check if the environment variable is set
if [ -z "$FULLNODE_API_INFO" ]; then
echo "FULLNODE_API_INFO is not set. Setting it now."
export FULLNODE_API_INFO="$ADMIN_TOKEN:/ip4/127.0.0.1/tcp/3456/http"
else
echo "FULLNODE_API_INFO is already set to: $FULLNODE_API_INFO"
fi
# Set FULLNODE_API_INFO
export FULLNODE_API_INFO="$ADMIN_TOKEN:/ip4/127.0.0.1/tcp/3456/http"

# Save the environment variable to a file
echo "export FULLNODE_API_INFO=\"$FULLNODE_API_INFO\"" > forest-archival.env
echo "export FULLNODE_API_INFO=\"$FULLNODE_API_INFO\"" > /tmp/forest-archival.env

# Source the file to load the environment variable
. forest-archival.env
. /tmp/forest-archival.env

# Use the environment variable
echo "Using FULLNODE_API_INFO: $FULLNODE_API_INFO"

0 comments on commit d35d5ba

Please sign in to comment.