Yes, yes it can be. I made a service to sit on my server, wait for the GPP-4323 to appear, and kill the beeper.
They really should have made this an option but w/e.
sudo pip install ping3
cat | sudo tee /opt/gpp4323-beep-off.py >/dev/null <<HACK
gpp_address = 'gpp-4323.lan'
import ping3, socket, time
was_visible = False
while True:
is_visible = bool(ping3.ping(gpp_address,timeout=.5))
if not was_visible and is_visible:
print(f"A wild GPP-4323 appeared.", flush=True)
mission_accomplished = False
attempt = 1
while not mission_accomplished:
try:
with socket.create_connection((gpp_address,1026),timeout=.5/6) as s:
print("Beeper killed. Mission accomplished.", flush=True)
s.send(b':SYST:BEEP:STAT 0\nLOCAL\n')
mission_accomplished = True
except:
pass
attempt += 1
if attempt >= 10:
print("We'll get 'em next time.")
break
if was_visible and not is_visible:
print("Poof.", flush=True)
if is_visible: # Didn't hit ping timeout, so manually rate limit here.
time.sleep(0.5)
was_visible = is_visible
HACK
cat | sudo tee /etc/systemd/system/gpp4323-beep-off.service >/dev/null <<THEPLANET
[Unit]
Description=Whenever GPP4323 appears, silence the beeper.
After=multi-user.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 /opt/gpp4323-beep-off.py
[Install]
WantedBy=multi-user.target
THEPLANET
sudo systemctl daemon-reload
sudo systemctl enable gpp4323-beep-off
sudo systemctl start gpp4323-beep-off
sudo journalctl -fu gpp4323-beep-off
EDIT: bugfix
EDIT2: perffix