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_ACK = 'IP_DISCOVERY_ACK'.encode() # ACK for broadcast
DISCOVERY_RSP_GTW = 'IP_DISCOVERY_RSP_GTW'.encode() # RSP for gateway DISCOVERY_RSP_GTW = 'IP_DISCOVERY_RSP_GTW'.encode() # RSP for gateway
DISCOVERY_RSP_MSH = 'IP_DISCOVERY_RSP_MSH'.encode() # RSP for mesh DISCOVERY_RSP_MSH = 'IP_DISCOVERY_RSP_MSH'.encode() # RSP for mesh
DISCOVERY_TIMEOUT = 1 DISCOVERY_TIMEOUT = 0.5
SOCKET_TIMEOUT = 0.2 SOCKET_TIMEOUT = 0.2
PORT_SERVER = 9434 PORT_SERVER = 9434
PORT_CLIENT = 9435 PORT_CLIENT = 9435
@ -73,5 +73,5 @@ def start_discovery_client():
return discovered_devices return discovered_devices
# devices = start_discovery_client() devices = start_discovery_client()
# print(f"Devices: {devices}") print(f"Devices: {devices}")

View File

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