Skip to content

Docker Image for monitor.sh

License

Notifications You must be signed in to change notification settings

forgenator/monitor.sh-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick reference

What is Monitor.sh?

Bluetooth-based passive presence detection of beacons, cell phones, and any other bluetooth device. The system is useful for mqtt-based home automation.

How to use this image

Configuration

When running the image, the default configuration is stored in /config. To use custom configuration, mount a local configuration directory to /config

First run

$ docker run -it --rm --net=host --cap-add=NET_ADMIN -v /opt/monitor.sh/config/:/config forgenator/monitor.sh

Use an empty local directory as a config dir - on first run the script will create empty configuration file that you have to edit:

known_beacon_addresses  
known_static_addresses   
mqtt_preferences

Running the image

--net=host is needed so the script will have access to hci0 --cap-add=NET_ADMIN is needed so that the script can cycle the hci0 bluetooth interface

$ docker run -it -d --net=host --cap-add=NET_ADMIN -v /opt/monitor.sh/config/:/config forgenator/monitor.sh

Running with different options

You can add different script options (refer to the script readme file)

$ docker run -it -d --net=host --cap-add=NET_ADMIN -v /opt/monitor.sh/config/:/config forgenator/monitor.sh bash monitor.sh -b -g

Displaying help / Running one-off commands

$ docker run -it --rm --net=host --cap-add=NET_ADMIN -v /opt/monitor.sh/config/:/config forgenator/monitor.sh bash monitor.sh -h

docker-compose

Here is a sample docker-compose file. You can drop the command if you don't need a custom command.

version: '3'
services:
  monitor.sh:
    image: forgenator/monitor.sh
    container_name: monitor.sh
    restart: unless-stopped
    environment:
      - TZ=Europe/Helsinki    
    volumes: 
      - /opt/monitor.sh/config:/config
      - /run/dbus:/run/dbus:fi
    privileged: true
    network_mode: host
    cap_add:
      - NET_ADMIN
    command: bash monitor.sh -e -x -g -D /config

Running:

$ docker-compose up -d monitor.sh

About

Docker Image for monitor.sh

Resources

License

Stars

Watchers

Forks