mirror of
https://github.com/30hours/blah2.git
synced 2024-11-18 12:33:58 +00:00
Fix docker compose and add restart script
This commit is contained in:
parent
88897b862a
commit
0e1cef7874
4 changed files with 20 additions and 5 deletions
10
README.md
10
README.md
|
@ -30,14 +30,14 @@ The build environment consists of a docker-compose.yml file running the followin
|
||||||
- Run the docker-compose command.
|
- Run the docker-compose command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone http://github.com/30hours/blah2
|
sudo git clone http://github.com/30hours/blah2 /opt/blah2
|
||||||
cd blah2
|
cd /opt/blah2
|
||||||
vim config/config.yml
|
vim config/config.yml
|
||||||
./lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run --tar -xvf
|
./lib/sdrplay-3.0.7/SDRplay_RSP_API-Linux-3.07.1.run --tar -xvf
|
||||||
./lib/sdrplay-3.0.7/install.sh
|
./lib/sdrplay-3.0.7/install.sh
|
||||||
sudo mkdir /opt/blah2
|
sudo docker network create blah2
|
||||||
sudo chmod a+rw /opt/blah2
|
sudo systemctl enable docker
|
||||||
sudo docker-compose up -d
|
sudo docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
The radar processing output is available on [http://localhost:49152](http://localhost:49152).
|
The radar processing output is available on [http://localhost:49152](http://localhost:49152).
|
||||||
|
|
|
@ -12,6 +12,8 @@ services:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
image: blah2
|
image: blah2
|
||||||
|
depends_on:
|
||||||
|
- blah2_api
|
||||||
volumes:
|
volumes:
|
||||||
- /dev/shm:/dev/shm
|
- /dev/shm:/dev/shm
|
||||||
- /run/systemd/system:/run/systemd/system
|
- /run/systemd/system:/run/systemd/system
|
||||||
|
|
12
script/blah2.bash
Executable file
12
script/blah2.bash
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Run script with a crontab to automatically restart on error.
|
||||||
|
# Checks the API to see if data is still being pushed through.
|
||||||
|
|
||||||
|
FIRST_CHAR=$(curl -s 127.0.0.1:3000/map | head -c1)
|
||||||
|
|
||||||
|
if [[ "$FIRST_CHAR" != "{" ]]; then
|
||||||
|
docker compose -f /opt/blah2/docker-compose.yml down
|
||||||
|
systemctl restart sdrplay.service
|
||||||
|
docker compose -f /opt/blah2/docker-compose.yml up -d
|
||||||
|
fi
|
1
script/crontab.txt
Normal file
1
script/crontab.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* * * * * /opt/blah2/script/blah2.bash
|
Loading…
Reference in a new issue