cleanup
This commit is contained in:
parent
4cd3c77a3e
commit
2b48e2f4a3
|
@ -46,10 +46,6 @@ start_server() {
|
||||||
echo "Server started as process $SERVER_PID"
|
echo "Server started as process $SERVER_PID"
|
||||||
}
|
}
|
||||||
|
|
||||||
# DEVICE
|
|
||||||
|
|
||||||
# SERVER
|
|
||||||
|
|
||||||
stop_processes() {
|
stop_processes() {
|
||||||
if [[ -n $DEVICE_PID ]]; then
|
if [[ -n $DEVICE_PID ]]; then
|
||||||
echo "Stopping device..."
|
echo "Stopping device..."
|
||||||
|
@ -64,11 +60,13 @@ stop_processes() {
|
||||||
# Trap SIGINT and SIGTERM to stop processes when the script is terminated
|
# Trap SIGINT and SIGTERM to stop processes when the script is terminated
|
||||||
trap stop_processes SIGINT SIGTERM
|
trap stop_processes SIGINT SIGTERM
|
||||||
|
|
||||||
|
# DEVICE
|
||||||
# Start device if DEVICE_START is True
|
# Start device if DEVICE_START is True
|
||||||
if [[ "$DEVICE_START" == "True" ]]; then
|
if [[ "$DEVICE_START" == "True" ]]; then
|
||||||
start_device
|
start_device
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# SERVER
|
||||||
# Start server if SERVER_START is True
|
# Start server if SERVER_START is True
|
||||||
if [[ "$SERVER_START" == "True" ]]; then
|
if [[ "$SERVER_START" == "True" ]]; then
|
||||||
start_server
|
start_server
|
||||||
|
|
Loading…
Reference in New Issue