Skip to content

Commit

Permalink
only export SERVER_IP env variable if its not empty (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
veggiesaurus authored Aug 4, 2021
1 parent 36df71a commit 01e0202
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/carta
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash

if [ "$(uname)" == "Darwin" ]
then
SERVER_IP=$(ipconfig getifaddr en0)
elif [ "$(uname)" == "Linux" ]
then
SERVER_IP=$(hostname -I | cut -d' ' -f1)
if [ "$(uname)" == "Darwin" ]; then
FIRST_IP=$(ipconfig getifaddr en0)
elif [ "$(uname)" == "Linux" ]; then
FIRST_IP=$(hostname -I | cut -d' ' -f1)
fi

export SERVER_IP
# Only export env variable if it's not empty
if [ ! -z $FIRST_IP ]; then
export SERVER_IP=$FIRST_IP
fi

carta_backend "$@"

0 comments on commit 01e0202

Please sign in to comment.