mirror of
https://github.com/km4ack/patmenu2.git
synced 2025-05-20 08:40:14 -07:00
commit
41a1537d7c
@ -1,6 +1,9 @@
|
|||||||
release=2.10.0
|
release=2.11.0
|
||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
2.11.0 add support for mobilinkd TNC 4
|
||||||
|
add auto start modem
|
||||||
|
fix false failure when starting vara modems
|
||||||
2.10.0 add VARA to getardoplist script
|
2.10.0 add VARA to getardoplist script
|
||||||
add VARA to getardoplist-cron script
|
add VARA to getardoplist-cron script
|
||||||
add Pat Autoconnect VARA script
|
add Pat Autoconnect VARA script
|
||||||
|
18
manage-pat
18
manage-pat
@ -4,7 +4,22 @@ export MYPATH=$HOME/patmenu2
|
|||||||
LOGO=$MYPATH/pmlogo.png
|
LOGO=$MYPATH/pmlogo.png
|
||||||
source $MYPATH/manage-pat-functions
|
source $MYPATH/manage-pat-functions
|
||||||
MAIN=$MYPATH/patmenu
|
MAIN=$MYPATH/patmenu
|
||||||
|
CUR=$(cat $MYPATH/.autostart.conf | awk -F "/" '{print $NF}' | sed 's/"//')
|
||||||
|
|
||||||
|
if [ -z "$CUR" ]; then
|
||||||
|
CUR=None
|
||||||
|
else
|
||||||
|
#set pretty name for display
|
||||||
|
if [ $CUR = 'start-vara-hf' ]; then
|
||||||
|
CUR=VARA-HF
|
||||||
|
elif [ $CUR = 'start-vara-fm' ]; then
|
||||||
|
CUR=VARA-FM
|
||||||
|
elif [ $CUR = 'start-pat-ardop' ]; then
|
||||||
|
CUR=ARDOP
|
||||||
|
elif [ $CUR = 'start-pat2m' ]; then
|
||||||
|
CUR=Packet
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-align=center \
|
yad --form --width=420 --text-align=center --center --title="Manage Pat" --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="|" \
|
||||||
@ -16,6 +31,7 @@ yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-
|
|||||||
--field="Set ARDOP PTT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; SETPTT"' \
|
--field="Set ARDOP PTT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; SETPTT"' \
|
||||||
--field="Set Listen Mode":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; LISTEN"' \
|
--field="Set Listen Mode":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; LISTEN"' \
|
||||||
--field="Add P2P Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; PEER"' \
|
--field="Add P2P Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; PEER"' \
|
||||||
|
--field="Auto Start Modem - <b>$CUR</b>":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; AUTOMODEM"' \
|
||||||
--field="Delete Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; DELETEALIAS"' \
|
--field="Delete Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; DELETEALIAS"' \
|
||||||
--field="Backup Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; BKUPCONFIG"' \
|
--field="Backup Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; BKUPCONFIG"' \
|
||||||
--field="Restore Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; RESTORECONFIG"' \
|
--field="Restore Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; RESTORECONFIG"' \
|
||||||
@ -27,5 +43,3 @@ if [ $BUT = 1 ]; then
|
|||||||
$MAIN &
|
$MAIN &
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $?
|
|
@ -598,6 +598,119 @@ $MAIN
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AUTOMODEM(){
|
||||||
|
CONF=$HOME/patmenu2/.autostart.conf
|
||||||
|
HTTP_ADDR=$(grep http_addr $HOME/.config/pat/config.json | sed 's/.*": "//;s/:.*//')
|
||||||
|
|
||||||
|
#pat server check
|
||||||
|
if [ "$HTTP_ADDR" = '127.0.0.1' ]; then
|
||||||
|
yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
|
||||||
|
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
|
||||||
|
--text="The Pat mailbox server is currently set to only accept connections from the Pi itself. \
|
||||||
|
Typically if using the auto modem start feature, you will be accessing the Pat mailbox from \
|
||||||
|
another device. Would you like to configure the system to accept connections over the network?" \
|
||||||
|
--button="Keep Current Settings":1 \
|
||||||
|
--button="Allow Network Connections":2
|
||||||
|
BUT=$?
|
||||||
|
if [ $BUT = 2 ]; then
|
||||||
|
cp $HOME/.config/pat/config.json $HOME/.config/pat/config.json.bkup
|
||||||
|
sed -i 's/127.0.0.1/0.0.0.0/' $HOME/.config/pat/config.json
|
||||||
|
sudo systemctl restart pat@`whoami`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
source $CONF
|
||||||
|
|
||||||
|
#Figure out which modem (if any) is set to auto start already and give it a pretty name.
|
||||||
|
CUR=$(echo $AUTO_CMD | awk -F "/" '{print $NF}')
|
||||||
|
if [ -z $CUR ]; then
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
if [ $CUR = 'start-vara-hf' ]; then
|
||||||
|
CUR=VARA-HF
|
||||||
|
elif [ $CUR = 'start-vara-fm' ]; then
|
||||||
|
CUR=VARA-FM
|
||||||
|
elif [ $CUR = 'start-pat-ardop' ]; then
|
||||||
|
CUR=ARDOP
|
||||||
|
elif [ $CUR = 'start-pat2m' ]; then
|
||||||
|
CUR=Packet
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#check to see if we already have a autostart in place. Give user
|
||||||
|
#a chance to delete before adding a new one. Can only have one
|
||||||
|
#modem starting at a time.
|
||||||
|
if [ -f $CONF ]; then
|
||||||
|
yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
|
||||||
|
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
|
||||||
|
--text="<b>Existing Auto Start Found - $CUR</b>\rYou must delete the existing auto start before creating a new one. \
|
||||||
|
Only one modem at a time can be set to auto start at boot." \
|
||||||
|
--button="Delete Current":1 \
|
||||||
|
--button="Keep Current":2
|
||||||
|
BUT=$?
|
||||||
|
if [ $BUT = 1 ]; then
|
||||||
|
crontab -l > /run/user/$UID/tempcron.txt
|
||||||
|
rm $CONF
|
||||||
|
sed -i '/patmenu2\/start/d' /run/user/$UID/tempcron.txt
|
||||||
|
crontab /run/user/$UID/tempcron.txt
|
||||||
|
elif [ $BUT = 2 ]; then
|
||||||
|
$MAIN &
|
||||||
|
exit
|
||||||
|
elif [ $BUT = 252 ]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AUTO=$(yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
|
||||||
|
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
|
||||||
|
--text="<b>Auto Modem Start</b> by KM4ACK" \
|
||||||
|
--field="Auto Start Modem on Boot":CB "NONE|VARA|VARA-FM|ARDOP|Packet")
|
||||||
|
BUT=$?
|
||||||
|
|
||||||
|
AUTO=$(echo $AUTO | awk -F "|" '{print $1}')
|
||||||
|
|
||||||
|
#give user chance to exit/cancel
|
||||||
|
if [ $BUT = 252 ]; then
|
||||||
|
exit
|
||||||
|
elif [ $BUT = 1 ]; then
|
||||||
|
$MAIN &
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
#set command per user selection
|
||||||
|
if [ "$AUTO" = 'VARA' ]; then
|
||||||
|
echo "VARA Selected"
|
||||||
|
AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-hf"
|
||||||
|
elif [ "$AUTO" = 'VARA-FM' ]; then
|
||||||
|
echo "VARA FM Selected"
|
||||||
|
AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-fm"
|
||||||
|
elif [ "$AUTO" = 'ARDOP' ]; then
|
||||||
|
echo "ARDOP Selected"
|
||||||
|
AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat-ardop"
|
||||||
|
elif [ "$AUTO" = 'Packet' ]; then
|
||||||
|
echo "Packet Selected"
|
||||||
|
AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat2m"
|
||||||
|
elif [ "$AUTO" = 'NONE' ]; then
|
||||||
|
$MAIN &
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
#send the command to the conf file
|
||||||
|
echo "AUTO_CMD=\"$AUTO_CMD\"" > $CONF
|
||||||
|
|
||||||
|
#add auto start to current cron job
|
||||||
|
crontab -l > /run/user/$UID/tempcron.txt
|
||||||
|
echo "@reboot $AUTO_CMD" >> /run/user/$UID/tempcron.txt
|
||||||
|
crontab /run/user/$UID/tempcron.txt
|
||||||
|
|
||||||
|
#give user feedback
|
||||||
|
yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
|
||||||
|
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
|
||||||
|
--text="$AUTO will auto start at boot\r\r<b>IMPORTANT NOTE!</b>\rThe sound card MUST be plugged in \
|
||||||
|
before booting the Pi or the auto start feature will FAIL." \
|
||||||
|
--button=gtk-ok
|
||||||
|
$MAIN &
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
24
mobilink
24
mobilink
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#script to connect mobilinkd TNC for ax25
|
#script to connect mobilinkd TNC for ax25
|
||||||
#20200602
|
#20200602
|
||||||
#20220304 last edit KM4ACK
|
#20230304 last edit KM4ACK
|
||||||
################################################################
|
################################################################
|
||||||
# #
|
# #
|
||||||
# # # # # # # ##### # # #
|
# # # # # # # ##### # # #
|
||||||
@ -78,23 +78,25 @@ hcitool scan > $TMPFILE
|
|||||||
#Decide if its a TNC 2 or 3
|
#Decide if its a TNC 2 or 3
|
||||||
TNC2=$(grep -i TNC2 $TMPFILE)
|
TNC2=$(grep -i TNC2 $TMPFILE)
|
||||||
TNC3=$(grep -i TNC3 $TMPFILE)
|
TNC3=$(grep -i TNC3 $TMPFILE)
|
||||||
if [ -z "$TNC2" ]
|
TNC4=$(grep -i TNC4 $TMPFILE)
|
||||||
then
|
if [ -n "$TNC2" ]; then
|
||||||
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
|
|
||||||
TNC=3
|
|
||||||
elif [ -z "$TNC3" ]
|
|
||||||
then
|
|
||||||
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
|
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
|
||||||
TNC=2
|
TNC=2
|
||||||
|
elif [ -n "$TNC3" ]; then
|
||||||
|
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
|
||||||
|
TNC=3
|
||||||
|
elif [ -n "$TNC4" ]; then
|
||||||
|
MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
|
||||||
|
TNC=4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#set correct connection commmand
|
#set correct connection commmand
|
||||||
if [ $TNC = "2" ]
|
if [ $TNC = "2" ]; then
|
||||||
then
|
|
||||||
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
|
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
|
||||||
elif [ $TNC = "3" ]
|
elif [ $TNC = "3" ]; then
|
||||||
then
|
|
||||||
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC 6"
|
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC 6"
|
||||||
|
elif [ $TNC = "4" ]; then
|
||||||
|
CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#See if device was found and connect if found
|
#See if device was found and connect if found
|
||||||
|
@ -32,7 +32,7 @@ FLRIG=$(echo $RIG | grep "\-m 4")
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#Check if modem is already running
|
#Check if modem is already running
|
||||||
MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm)
|
MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
|
||||||
if [ ! -z "$MODEMCHECK" ]; then
|
if [ ! -z "$MODEMCHECK" ]; then
|
||||||
yad --title="FAILED" --width=400 --height=100 \
|
yad --title="FAILED" --width=400 --height=100 \
|
||||||
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
|
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
|
||||||
@ -111,7 +111,7 @@ echo "starting VARA-FM"
|
|||||||
sleep 7 #give vara time to start
|
sleep 7 #give vara time to start
|
||||||
|
|
||||||
#verify vara has started
|
#verify vara has started
|
||||||
PIDVARA=$(ps aux | grep -i box86 | grep -i varafm)
|
PIDVARA=$(ps aux | grep -i wine | grep -i varafm)
|
||||||
if [ -z "$PIDVARA" ]
|
if [ -z "$PIDVARA" ]
|
||||||
then
|
then
|
||||||
yad --title="FAILED" --width=400 --height=100 \
|
yad --title="FAILED" --width=400 --height=100 \
|
||||||
|
@ -33,7 +33,7 @@ FLRIG=$(echo $RIG | grep "\-m 4")
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#Check if modem is already running
|
#Check if modem is already running
|
||||||
MODEMCHECK=$(ps aux | grep -i box86 | grep -i varafm)
|
MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
|
||||||
if [ ! -z "$MODEMCHECK" ]; then
|
if [ ! -z "$MODEMCHECK" ]; then
|
||||||
yad --title="FAILED" --width=400 --height=100 \
|
yad --title="FAILED" --width=400 --height=100 \
|
||||||
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
|
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
|
||||||
@ -112,7 +112,7 @@ echo "starting VARA HF"
|
|||||||
sleep 7 #give vara time to start
|
sleep 7 #give vara time to start
|
||||||
|
|
||||||
#verify vara has started
|
#verify vara has started
|
||||||
PIDVARA=$(ps aux | grep -i box86 | grep VARA.exe)
|
PIDVARA=$(ps aux | grep -i wine | grep VARA.exe)
|
||||||
if [ -z "$PIDVARA" ]
|
if [ -z "$PIDVARA" ]
|
||||||
then
|
then
|
||||||
yad --title="FAILED" --width=400 --height=100 \
|
yad --title="FAILED" --width=400 --height=100 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user