forked from fonoster/fonoster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Validate that there is no project installation in the current directory | ||
function check_if_installed() { | ||
PROJECT_ENV="fonoster/operator/.env" | ||
|
||
if [[ -f $PROJECT_ENV ]]; then | ||
error "You already have a project installed in this directory. Please, remove the current installation first as this may cause issues." | ||
fi | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Validate the required ports are available for the application | ||
function check_ports() { | ||
for port in "$@"; do | ||
[ -z "$port" ] && error "Port '$port' is not a valid port" | ||
|
||
PORT_USED="$(netstat -lnt | awk '{print $4}' | grep -E ":$port$")" | ||
|
||
if [ -n "$PORT_USED" ]; then | ||
warning "Port '$port' is already in use by another process, please stop the process and try again." | ||
|
||
echo -e "$PORT_USED" | ||
|
||
warning "Another option is run the container with the '-e HTTPS_PORT' option to specify a different port." | ||
|
||
error "Unable to continue. Exiting..." | ||
fi | ||
done | ||
} |