+ some logs for workers [WRKR]

merge-requests/2/head
Dominika Liberda 2020-10-05 02:23:14 +02:00
parent e84efbc9b0
commit 3e01d1147e
3 changed files with 6 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
secret/*
app

View File

@ -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 &

View File

@ -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
}