Story: I have a small IoT project involving inputs from several sensors, one of them is an IPC's hi-res snapshots (I'm using keras's deep learning to repeatedly monitor certain real-world situations on my property). Currently, I have made a solution to access sensors' values through
ircd-hybrid hosted on the pi, a simple IRC robot I coded, and IRC clients on our team's mobile devices. It allows me to query sensor's states as well as send push notifications (iOS, Android) whenever keras detects anything abnormal on my property.
Problem: I want to implement a way to allow my IRC bot to send out sensors' status at different "levels of detail" depending on IRC clients' (our mobile devices) network. So that: When a phone is using cellular network (
userIp.startswith(192.168) is False) I want action #1 (services with less "level of details". e.g. limited sensors' output, and not sharing image links); When my phone is within the local network (
userIp.startswith(192.168) is True), I want action #2 (services with greater "level of details". e.g. enable local network-only operations and sharing image links). But the problem is I don't know how to find IRC clients' IP addresses. I have checked
/var/log/ircd/ircd-hybrid-user.log on the pi and found all user's IPs are like this:
[2019-06-11T10:46:34+0800] Tue Jun 11 10:45:09 2019 (85): Igloofirstname.lastname@example.org 127.0.0.1 * 2/0 :Igloo
Does anybody have an idea how I can track users' IPs? I'm new to IRC. I've done some research (eg. user modes) but in vain -- to me it seems
ircd-hybrid for Raspbian doesn't record user's IPs. Please correct me if I'm wrong.
Thanks so much!
 My IRC client automatically downloads images whenever an image link is deteted through its 'preview media' capability and I like it a lot when I'm in the local network but don't want it for non-local network.