Skip to content
Snippets Groups Projects
progetto.bash 1.34 KiB
Newer Older
Alfredo Chissotti's avatar
Alfredo Chissotti committed
#creo un nuovo terminale per ascoltare mosquitto
#screen -c -X "mosquitto_sub -t '#' -h luci.local -u gruppo2 -P funziona -v" &
mqtt=$(cat ./mqtt.txt)
Alfredo Chissotti's avatar
Alfredo Chissotti committed
osascript << EOF
	tell app "Terminal"
		do script "$mqtt"
Alfredo Chissotti's avatar
Alfredo Chissotti committed
	end tell
EOF

#inserite al fondo della seguente riga il comando che vi serve per far partire il vostro microservizio, facendo attenzione a farlo precedere da una & per eseguire il tutto in parallelo; la doppia && serve per far eseguire le operazioni una dopo l'altra
#per luci: basta rimuovere il cancelletto qui sotto 

cd WebServer && bash server.bash $1 & cd ScenariMicroservizio && bash scenari.bash $1 & cd antifurto && bash antifurto.bash $1 #& cd LuciMicro && bash luci.bash

#chiudo tutto il resto
#tokill=$(ps | grep 'progetto.bash' && ps | grep 'code.Server' && ps | grep 'server.bash')
#nogrep=$(grep -wv grep <<< "$tokill")

for i in ` ps -ef | grep "code.Server" | grep -v grep | awk '{print $2}'`
do    
  kill -15 $i
done

for i in ` ps -ef | grep "code.Luci" | grep -v grep | awk '{print $2}'`
do
  kill -15 $i
done

for i in ` ps -ef | grep "scenari.Scenari" | grep -v grep | awk '{print $2}'`
do
  kill -15 $i
done

for i in ` ps -ef | grep "code.Antifurto" | grep -v grep | awk '{print $2}'`
do
  kill -15 $i
done

for i in ` ps -ef | grep "mosquitto_sub" | grep -v grep | awk '{print $2}'`
do
  kill -15 $i
done

Alfredo Chissotti's avatar
Alfredo Chissotti committed
echo '
tutto chiuso'