-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only export SERVER_IP env variable if its not empty (#890)
- Loading branch information
1 parent
36df71a
commit 01e0202
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |