passer par un alias pour les websockets

This commit is contained in:
2021-12-07 16:47:22 +01:00
parent 01da55e6d6
commit 6081e6a692
10 changed files with 45 additions and 120 deletions

View File

@ -1,11 +1,9 @@
#!/bin/bash
websocket_url=$(CreoleGet adresse_ip_eth0 non)
websocket_portinterne=$(CreoleGet ninegate_websocket_portinterne non)
# Server Websocket
if [[ "$1" != "restartifdown" ]]; then
echo WEBSOCKET = STOP
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
pid="$(pgrep -a -f gos:websocket | grep 5556)"
if [ -n "${pid}" ]; then
IFS=' ' read -r -a array <<< "$pid"
kill -9 ${array[0]};
@ -13,7 +11,7 @@ if [[ "$1" != "restartifdown" ]]; then
fi
# Port LISTEN ?
pid="$(pgrep -a -f gos:websocket | grep $websocket_portinterne)"
pid="$(pgrep -a -f gos:websocket | grep 5556)"
restart="yes"
if [ "$1" == "restartifdown" ] && [ -n "${pid}" ] ; then
restart="no"
@ -22,5 +20,5 @@ fi
if [ "$restart" == "yes" ] && [ "$1" != "stop" ] ; then
echo WEBSOCKET = START
cd /var/www/html/ninegate
bin/console gos:websocket:server --port $websocket_portinterne -a $websocket_url --no-debug -n -q --env=prod & disown
systemctl restart wssninegate
fi