bugfix: -d mode didn't worked

This commit is contained in:
DasMoorhuhn 2024-08-29 01:18:32 +02:00
parent dce761eec3
commit 97adf45c51
2 changed files with 9 additions and 28 deletions

View File

@ -10,7 +10,7 @@ DEBUG = True if os.environ.get('DEBUG') is not None else False
DISCOVERY_ACK = 'IP_DISCOVERY_ACK'.encode() # ACK for broadcast
DISCOVERY_RSP_GTW = 'IP_DISCOVERY_RSP_GTW'.encode() # RSP for gateway
DISCOVERY_RSP_MSH = 'IP_DISCOVERY_RSP_MSH'.encode() # RSP for mesh
DISCOVERY_TIMEOUT = 1
DISCOVERY_TIMEOUT = 0.5
SOCKET_TIMEOUT = 0.2
PORT_SERVER = 9434
PORT_CLIENT = 9435
@ -73,5 +73,5 @@ def start_discovery_client():
return discovered_devices
# devices = start_discovery_client()
# print(f"Devices: {devices}")
devices = start_discovery_client()
print(f"Devices: {devices}")

View File

@ -46,19 +46,8 @@ docker_run() {
check_for_devices_config
if [ "$SKIP_ENV" = true ]; then
echo "Skip env file"
ENV_EXISTS=false
BACKGROUND=""
TIME_ZONE=""
NAME=""
INTERACTIVE=true
BUILD=true
API=true
DEBUG="INFO"
MODE="1"
LOOP="40"
TIMEOUT="20"
else
if [ -e .env ]
then
@ -69,9 +58,7 @@ docker_run() {
echo No env file found
ENV_EXISTS=false
BACKGROUND=""
TIME_ZONE=""
NAME=""
INTERACTIVE=true
BUILD=true
API=true
@ -96,6 +83,10 @@ docker_run() {
COMMAND="$COMMAND --env-file .env"
fi
if [ "$BACKGROUND" = "--detach" ]; then
INTERACTIVE=false
fi
if [ "$INTERACTIVE" = true ]; then
COMMAND="$COMMAND --interactive"
COMMAND="$COMMAND --tty"
@ -154,66 +145,57 @@ while [ "$1" != "" ]; do
case $1 in
-se | --skip-env-file )
SKIP_ENV=true
echo "Skip env file"
shift
;;
-d )
BACKGROUND="-d"
BACKGROUND="--detach"
shift
;;
--debug )
shift
DEBUG=$1
SKIP_ENV=true
shift
;;
-a | --api)
API=true
SKIP_ENV=true
shift
;;
-b | --build )
BUILD=true
SKIP_ENV=true
shift
;;
-v | --volume )
shift
VOLUME=$1
SKIP_ENV=true
shift
;;
-n | --name )
shift
NAME=$1
SKIP_ENV=true
shift
;;
-m2 | --mesh-gateway)
MODE=2
SKIP_ENV=true
shift
;;
-tz | --timezone )
shift
TIME_ZONE=$1
SKIP_ENV=true
shift
;;
-to | --timeout )
shift
TIMEOUT=$1
SKIP_ENV=true
shift
;;
-t | --tag )
shift
TAG=$1
SKIP_ENV=true
shift
;;
-l | --loop )
shift
SKIP_ENV=true
firstchar=`echo $1 | cut -c1-1`
if [ "$firstchar" = "-" ]; then
LOOP=0
@ -226,7 +208,6 @@ while [ "$1" != "" ]; do
;;
-i | --interactive )
INTERACTIVE=true
SKIP_ENV=true
shift
;;
-h | --help )