mirror of
https://github.com/status-im/status-react.git
synced 2025-01-10 19:16:59 +00:00
Fix scripts/start-react-native.sh
so it can handle multiple processes listening on port 8081
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
c9c778c063
commit
085f3c31b2
@ -6,11 +6,11 @@ YELLOW='\033[1;33m'
|
|||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
METRO_PORT=8081
|
METRO_PORT=8081
|
||||||
METRO_PID="$(lsof -i :${METRO_PORT} | awk 'NR!=1 {print $2}')"
|
METRO_PID="$(lsof -i :${METRO_PORT} | awk 'NR!=1 {print $2}' | sort -u | tr '\r\n' ' ')"
|
||||||
if [ ! -z $METRO_PID ]; then
|
if [ ! -z "$METRO_PID" ]; then
|
||||||
echo -e "${YELLOW}TCP port ${METRO_PORT} is required by the Metro packager.\nThe following process currently has the port open, preventing Metro from starting:${NC}"
|
echo -e "${YELLOW}TCP port ${METRO_PORT} is required by the Metro packager.\nThe following processes currently have the port open, preventing Metro from starting:${NC}"
|
||||||
ps -fp $METRO_PID
|
ps -fp $METRO_PID
|
||||||
echo -e "${YELLOW}Do you want to terminate it (y/n)?${NC}"
|
echo -e "${YELLOW}Do you want to terminate them (y/n)?${NC}"
|
||||||
read -n 1 term
|
read -n 1 term
|
||||||
[[ $term == 'y' ]] && kill $METRO_PID
|
[[ $term == 'y' ]] && kill $METRO_PID
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user