This configuration is broadly similar to Red PE1RRR's configuration, although due to what I suspect is some subtle difference between inetd
and systemd
, his expect script resulted in some strange terminal behavour.
systemd
Units
Define the conversd
service with conversd.service
:
[Unit]
Description=conversd
After=network.target
[Service]
PrivateTmp=true
Type=forking
ExecStart=/usr/local/sbin/conversd
[Install]
WantedBy=multi-user.target
We could at this point just let linbpq
connect out to port 3600, however it would be nice if users didn't have to enter their callsign.
Instead we'll provide socket 3601 for linbpq
with conversd.socket
:
[Unit]
Description=conversd socket
[Socket]
ListenStream=3601
Accept=yes
[Install]
WantedBy=sockets.target
Connections to this port will then spawn conversd@.service
:
[Unit]
Description=conversd
PartOf=conversd.socket
[Service]
ExecStart=/home/pi/convers-saupp/conversd.sh
StandardInput=socket
... which uses the following script to read the callsign from linbpq
and send it to conversd
on 3600:
#!/usr/bin/expect
#set stty_init -echo
gets stdin callsign
spawn -noecho -nottyinit -nottycopy nc 127.0.0.1 3600
send "/n $callsign\n"
interact
exit
linbpq
Configuration
We can then set up the application in linpq:
APPLICATION 3,WWCHAT,C 3 HOST 0 S,MB7NLB-3,BUZWWC,255