1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-17 23:30:11 -07:00

add vara listen

This commit is contained in:
KM4ACK 2023-06-18 09:29:19 -05:00
parent eaca30fdca
commit 6e74b14ac7

View File

@ -362,6 +362,7 @@ yad --form --width=400 --text-align=center --center --title="Grid Update" --text
$MAIN $MAIN
} }
LISTEN(){ LISTEN(){
#This funtion sets the listen modes for Pat Winlink #This funtion sets the listen modes for Pat Winlink
WHO=$(whoami) WHO=$(whoami)
@ -378,6 +379,8 @@ LISTEN=$(yad --center --list --checklist --width=600 --height=300 --separator="|
false "TELNET" "Connection over Internet or Mesh" \ false "TELNET" "Connection over Internet or Mesh" \
false "AX25" "Packet Connections 2M-440" \ false "AX25" "Packet Connections 2M-440" \
false "ARDOP" "HF Connections using ARDOP Modem" \ false "ARDOP" "HF Connections using ARDOP Modem" \
false "VARAHF" "HF Connections using VARA Modem" \
false "VARAFM" "FM Connections using VARA Modem" \
--button="Main Menu":1 \ --button="Main Menu":1 \
--button="Set Listen Mode":2 \ --button="Set Listen Mode":2 \
--button="Stop Listening":3) --button="Stop Listening":3)
@ -394,6 +397,8 @@ echo $LISTEN > $TEMP
TELNET=$(grep TELNET $TEMP) TELNET=$(grep TELNET $TEMP)
ARDOP=$(grep ARDOP $TEMP) ARDOP=$(grep ARDOP $TEMP)
AX25=$(grep AX25 $TEMP) AX25=$(grep AX25 $TEMP)
VARAHF=$(grep VARAHF $TEMP)
VARAFM=$(grep VARAFM $TEMP)
#Set telnet variable #Set telnet variable
if [ -n "$TELNET" ]; then if [ -n "$TELNET" ]; then
TELNET="telnet," TELNET="telnet,"
@ -406,6 +411,14 @@ AX25=$(grep AX25 $TEMP)
if [ -n "$AX25" ]; then if [ -n "$AX25" ]; then
AX25="ax25," AX25="ax25,"
fi fi
#set varafm variable
if [ -n "$VARAFM" ]; then
VARAFM="varafm,"
fi
#set varahf variable
if [ -n "$VARAHF" ]; then
VARAHF="varahf,"
fi
cat <<EOF > $TEMP cat <<EOF > $TEMP
[Unit] [Unit]
Description=pat - Winlink client for %I Description=pat - Winlink client for %I
@ -421,13 +434,13 @@ Restart=on-failure
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
#add listen modes set by user #add listen modes set by user
sed -i "s|Exec.*|ExecStart=/usr/bin/pat -l $TELNET$ARDOP$AX25 http|" $TEMP sed -i "s|Exec.*|ExecStart=/usr/bin/pat -l $TELNET$ARDOP$AX25$VARAFM$VARAHF http|" $TEMP
sudo -A cp $TEMP /lib/systemd/system/pat@.service sudo cp $TEMP /lib/systemd/system/pat@.service
sudo -A systemctl daemon-reload sudo systemctl daemon-reload
sudo -A systemctl restart pat@$WHO sudo systemctl restart pat@$WHO
yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \ yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Listen mode set to $TELNET$ARDOP$AX25</b>" \ --text="<b>Listen mode set to $TELNET$ARDOP$AX25$VARAFM$VARAHF</b>" \
--button=gtk-ok --button=gtk-ok
$MAIN & $MAIN &
exit exit
@ -447,9 +460,9 @@ Restart=on-failure
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
sudo -A cp $TEMP /lib/systemd/system/pat@.service sudo cp $TEMP /lib/systemd/system/pat@.service
sudo -A systemctl daemon-reload sudo systemctl daemon-reload
sudo -A systemctl restart pat@$WHO sudo systemctl restart pat@$WHO
fi fi
yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \ yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \