Compare commits

..

No commits in common. "master" and "v2" have entirely different histories.
master ... v2

5 changed files with 16 additions and 7 deletions

2
.gitmodules vendored
View File

@ -1,4 +1,4 @@
[submodule "com"]
path = com
url = https://git.xdrm.io/logauth/bash-com.git
url = https://git.xdrm.io/xdrm-brackets/bash-socket.git
branch = master

2
com

@ -1 +1 @@
Subproject commit af9f200188e3e90eda8aef7a1cb306712fd67924
Subproject commit e4fabe885339bd927648d114c6783732d9ee846b

7
daemon
View File

@ -18,11 +18,14 @@ touch $ROOT/.lock;
# (2) Set traps before starting any subproccess
#--------------------------------------------------------#
trap "rm $ROOT/.lock 2>/dev/null; exit 1;" HUP INT KILL TERM;
trap "rm $ROOT/.lock 2>/dev/null; exit 1;" INT KILL;
# (3) Wait for trigger to launch server
#--------------------------------------------------------#
# (1) Wait for trigger #
$ROOT/com/pool key123 9999
$ROOT/com/trigger 9999;
# (2) Launch server #
$ROOT/com/launch ioemu $SATS_IP 44440 44441;

View File

@ -17,11 +17,14 @@ test ! -f $ROOT/.lock && echo "Daemon not started" && exit 1;
# (1) Initialise vars #
LED="0"; Rx=(0 0 0); # led; relays
# (2) Get BUF_IN #
source $ROOT/com/config/ioemu;
while sleep 1; clear; do
# (3) Get last value from lines beginning by 'GSTA' #
STATE="`$ROOT/com/read gpio | grep -Po "^GPIO(.+)$" | sed 's/^GPIO\(....\)$/\1/g' | tail -n1`";
STATE="`cat $BUF_IN | grep -Po "^GPIO(.+)$" | sed 's/^GPIO\(....\)$/\1/g' | tail -n1`";
echo "state: $STATE";
@ -43,4 +46,4 @@ while sleep 1; clear; do
echo -n "R2: "; $ROOT/src/disp-relay ${Rx[2]};
echo -n "R3: "; $ROOT/src/disp-relay ${Rx[3]};
done;
done;

View File

@ -17,11 +17,14 @@ test ! -f $ROOT/.lock && echo "Daemon not started" && exit 1;
# (1) Initialise vars #
declare -A SERV;
# (2) Get BUF_IN #
source $ROOT/com/config/ioemu;
# (3) For each service update #
while sleep 1; clear; do
# (4) Get last value from lines beginning by 'GSTA' #
SERV_LIST="`$ROOT/com/read systemd | grep -Po "^SYSD(.+)$" | sed 's/^SYSD\(.\+\)$/\1/g' | tail -n20`";
SERV_LIST="`cat $BUF_IN | grep -Po "^SYSD(.+)$" | sed 's/^SYSD\(.\+\)$/\1/g' | tail -n20`";
# (5) Store each service #
while IFS= read -r line; do