option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
+# RaspberryPi4
+config host
+ option ip '192.168.1.192'
+ option mac '74:da:38:0d:05:56'
+
+# RaspberryPi2
+config host
+ option ip '192.168.1.191'
+ option mac '74:da:38:0d:05:55'
+
+# RaspberryPi1
+config host
+ option ip '192.168.1.108'
+ option mac '74:da:38:68:72:8a'
+
+# Android Phone
+config host
+ option ip '192.168.1.50'
+ option mac '64:bc:0c:43:3f:40'
+
+# Amcrest Camera 1
+config host
+ option ip '192.168.1.195'
+ option mac '3c:ef:8c:7f:c0:19'
+
+# Amcrest Camera 2
+config host
+ option ip '192.168.1.196'
+ option mac '3c:ef:8c:6f:79:5a'
+
+# iHome Speaker 1
+config host
+ option ip '192.168.1.119'
+ option mac 'c8:d5:fe:e6:ad:96'
+
+# iHome Speaker 2
+config host
+ option ip '192.168.1.234'
+ option mac 'c8:d5:fe:e6:a2:d8'
+
+# ESP board
+config host
+ option ip '192.168.1.222'
+ option mac '18:fe:34:db:59:72'
+
+# Lifx light bulb 1
+config host
+ option ip '192.168.1.126'
+ option mac 'd0:73:d5:12:8e:30'
+
+# Lifx light bulb 2
+config host
+ option ip '192.168.1.232'
+ option mac 'd0:73:d5:02:41:da'
+
+# WeMo
+config host
+ option ip '192.168.1.145'
+ option mac '94:10:3e:36:60:09'
+
--- /dev/null
+74:da:38:0d:05:56 1qaz2wsx3edcPi4
+74:da:38:0d:05:55 1qaz2wsx3edcPi2
+74:da:38:68:72:8a 1qaz2wsx3edcPi1
+64:bc:0c:43:3f:40 1qaz2wsx3edcPhone
+3c:ef:8c:7f:c0:19 1qaz2wsx3edcCam1
+3c:ef:8c:6f:79:5a 1qaz2wsx3edcCam2
+c8:d5:fe:e6:ad:96 1qaz2wsx3edcSpk1
+c8:d5:fe:e6:a2:d8 1qaz2wsx3edcSpk2
+18:fe:34:db:59:72 1qaz2wsx3edcEsp
+d0:73:d5:12:8e:30 1qaz2wsx3edcLight1
+d0:73:d5:02:41:da 1qaz2wsx3edcLight2
+94:10:3e:36:60:09 1qaz2wsx3edc
option ssid 'LEDE'
option encryption 'psk2'
option key '1qaz2wsx3edc'
+ option wpa_psk_file '/etc/config/hostapd-psk'
option isolate '1'
config wifi-device 'radio1'
option ssid 'LEDE'
option encryption 'psk2'
option key '1qaz2wsx3edc'
+ option wpa_psk_file '/etc/config/hostapd-psk'
option isolate '1'
--- /dev/null
+Device registration utility for Sentinel system
+This is a simple script that register a new device
+into /etc/config/dhcp and /etc/hostapd-psk
+Copyright (c) 2015-2017, Rahmadi Trimananda <rtrimana@uci.edu> PLRG@UCIrvine
+
+Usage:
+ ./register_device.sh [-h]
+ ./register_device.sh [-a <mac-address> <ip-address> <key> <device-name>]
+ ./register_device.sh [-l]
+
+Options:
+ -h show this usage
+ -a adding device by putting MAC address, desired IP address, key, and device name (optional)
+ -l show list of devices registered
+
+
+Notes:
+- This simple script now only adds device information (no delete feature)
+- Meant to ease the setup process (mimicking production environment)
--- /dev/null
+12:32:34:45:56:67 192.168.2.123 mydevice
+12:32:34:45:56:67 192.168.2.123 mydevice
--- /dev/null
+#!/bin/sh
+
+# Print usage
+if [ "$#" -eq 0 ] || [ "$1" == "-h" ]; then
+ echo "Device registration utility for Sentinel system"
+ echo "This is a simple script that register a new device"
+ echo "into /etc/config/dhcp and /etc/hostapd-psk"
+ echo "Copyright (c) 2015-2017, Rahmadi Trimananda <rtrimana@uci.edu> PLRG@UCIrvine"
+ echo ""
+ echo "Usage:"
+ echo " ./register_device.sh [-h]"
+ echo " ./register_device.sh [-a <mac-address> <ip-address> <key> <device-name>]"
+ echo " ./register_device.sh [-l]"
+ echo ""
+ echo "Options:"
+ echo " -h show this usage"
+ echo " -a adding device by putting MAC address, desired IP address, key, and device name (optional)"
+ echo " -l show list of devices registered"
+ echo ""
+
+elif [ "$1" == "-a" ]; then
+
+ if [ "$2" == "" ] || [ "$3" == "" ] || [ "$4" == "" ]; then
+ echo "Empty or incomplete parameters! Please run ./register_device.sh -h for usage."
+ else
+ # Add a new device
+ MAC=$2
+ IP=$3
+ KEY=$4
+
+ # Keep a local log
+ echo "$MAC $IP $KEY $5" >> devices.dat
+
+ # Insert into /etc/hostapd-psk
+ echo "$MAC $KEY" >> /etc/hostapd-psk
+
+ # Insert into /etc/config/dhcp
+ echo "" >> /etc/config/dhcp
+ if [ "$5" != "" ]; then # If device-name is not empty
+ echo "# $5" >> /etc/config/dhcp
+ fi
+ echo "config host" >> /etc/config/dhcp
+ echo " option ip '$IP'" >> /etc/config/dhcp
+ echo " option mac '$MAC'" >> /etc/config/dhcp
+
+ if [ "$5" != "" ]; then # If device-name is not empty
+ echo " option name '$5'" >> /etc/config/dhcp
+ fi
+ echo "Device added!"
+ fi
+
+elif [ "$1" == "-l" ]; then
+ # Print list of devices
+ echo "List of devices"
+ cat devices.dat
+ echo ""
+ echo "/etc/hostapd-psk"
+ cat /etc/hostapd-psk
+else
+ echo "Unknown option. Please run ./register_device.sh -h for usage."
+fi
+
--- /dev/null
+cat /tmp/dhcp.leases