From 3e01d1147e3f07e1a2fb6b206cb3b6e10740b704 Mon Sep 17 00:00:00 2001 From: Dominika Liberda Date: Mon, 5 Oct 2020 02:23:14 +0200 Subject: [PATCH] + some logs for workers [WRKR] --- .gitignore | 2 ++ http.sh | 4 ++-- src/worker.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad83071 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +secret/* +app diff --git a/http.sh b/http.sh index 072136a..4f2bcc9 100755 --- a/http.sh +++ b/http.sh @@ -46,14 +46,14 @@ LauraIsCute exit 0 fi +echo "HTTP.sh" + source src/worker.sh if [[ -f "${cfg[namespace]}/config.sh" ]]; then source "${cfg[namespace]}/config.sh" fi -echo "HTTP.sh" - if [[ ${cfg[http]} == true ]]; then echo "[HTTP] listening on ${cfg[ip]}:${cfg[port]}" ncat -v -l ${cfg[ip]} ${cfg[port]} -c ./src/server.sh -k 2>> /dev/null & diff --git a/src/worker.sh b/src/worker.sh index 2fcf087..dec4363 100755 --- a/src/worker.sh +++ b/src/worker.sh @@ -5,6 +5,7 @@ # worker_add(name, interval) function worker_add() { if [[ -x "${cfg[namespace]}/workers/$1/worker.sh" ]]; then + echo "[WRKR] adding worker $1" while true; do source "${cfg[namespace]}/workers/$1/worker.sh" sleep $2 @@ -20,7 +21,7 @@ function worker_add() { fi done & else - echo "You have a broken worker configuration! Please check if worker.sh in worker $1 is executable." + echo "[WRKR] Broken config - workers/$1/worker.sh does not exist, or is not executable?" fi }