├── .getardoplist-cron
├── .gitignore
├── 891.km4ack.config
├── FA-functions
├── LICENSE
├── README.md
├── auto-download
├── autopat
├── autopat-vara
├── cat-functions
├── catalog
├── changelog
├── config
├── convert_to_aprs
├── default.config
├── find2
├── getardoplist
├── getgrid
├── griblist
├── grid-map.pdf
├── manage-form-functions
├── manage-forms
├── manage-inbox
├── manage-inbox-functions
├── manage-menu
├── manage-menu-functions
├── manage-pat
├── manage-pat-functions
├── mobi-pair
├── mobi-wired
├── mobilink
├── modems
├── pat-functions
├── patmenu
├── patmenu2.desktop
├── pmlogo.png
├── setup
├── sms
├── add-carrier
├── cellproviders.txt
├── current-carriers
├── manage-sms
├── myphonelist.txt
├── remove-carrier
└── winlink2sms
├── start-pat-ardop
├── start-pat2m
├── start-vara-fm
├── start-vara-hf
├── stop-modems
├── weather.txt
└── worldgridmap.pdf
/.getardoplist-cron:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #This script will download the ardop list to the path set below
4 | #It is intended to be run by cron daily
5 | #to keep the list current. km4ack 20181214
6 | #Hint: create a cron job that reads
7 | #30 23 * * * /usr/local/bin/getardoplist
8 | #This script is provided AS IS
9 | #Feel free to mod for your use
10 |
11 | #Two versions of this script exist. One for manual downloads and
12 | #one for cron downloads. The one for cron has no YAD interface.
13 | #Cron wouldn't run correctly with YAD in the code. The other file
14 | #is .getardoplist-cron
15 |
16 | TODAY=$(date)
17 |
18 | #path where files are located
19 | #must match path in findardop script
20 | MYPATH=$HOME/patmenu2/ardop-list/
21 | MYVARA=$HOME/patmenu2/vara-list/
22 |
23 | #my log file
24 | LOG=$HOME/Documents/mylog.txt
25 |
26 | #set config file location for pat version
27 | VERSION=$(pat version | awk '{print $2}' | awk -F "." '{print $2}')
28 | if [ $VERSION -le 11 ]; then
29 | MYCONFIG=$HOME/.wl2k/config.json
30 | else
31 | MYCONFIG=$HOME/.config/pat/config.json
32 | fi
33 |
34 | GRIDCK=$(jq .locator $MYCONFIG)
35 | if [ ${#GRIDCK} -lt 3 ]
36 | then
37 | echo "Grid square not set in Pat Configure" | tee -a $LOG
38 | echo "Distances/Bearings will not be accurate"
39 | exit
40 | fi
41 |
42 | GRID=$(grep locator $MYCONFIG | sed 's/"locator"://;s/"//g;s/,//;s/ //g')
43 | echo "GRID=$GRID" > $HOME/patmenu2/.grid
44 |
45 | #make directory if it doesn't exist
46 | mkdir -p $MYPATH
47 | mkdir -p $MYVARA
48 |
49 | #set variables for each ARDOP list
50 | FILE=$MYPATH'ardoplist.txt'
51 | EIGHTY=$MYPATH'80mardoplist.txt'
52 | FORTY=$MYPATH'40mardoplist.txt'
53 | TWENTY=$MYPATH'20mardoplist.txt'
54 | THIRTY=$MYPATH'30mardoplist.txt'
55 | PACKET=$MYPATH'packet.txt'
56 |
57 | #set variables for each vara list
58 | VARAFILE=$MYVARA'varalist.txt'
59 | VARAEIGHTY=$MYVARA'80mvaralist.txt'
60 | VARAFORTY=$MYVARA'40mvaralist.txt'
61 | VARATWENTY=$MYVARA'20mvaralist.txt'
62 | VARATHIRTY=$MYVARA'30mvaralist.txt'
63 | VARAFM=$MYVARA'varafm.txt'
64 |
65 | #check internet connection
66 | echo "Please wait while we check your internet connection"
67 | echo "This may take up to a minute"
68 | wget -q --tries=5 --timeout=10 --spider http://google.com
69 | if [[ $? -eq 0 ]]; then
70 | echo
71 |
72 | echo
73 | echo "Please wait while files are download"
74 | echo "This may take several minutes"
75 | echo "Depending on your internet speed"
76 | else
77 |
78 | #check for internet before attempting to download the list
79 |
80 | internet=1 #set the test to false
81 |
82 | while [ "$internet" = 1 ]; do
83 | echo "check for internet connection"
84 | ping -c 5 8.8.8.8
85 | internet=$?
86 | sleep 60 #wait one minute before trying again
87 | done
88 |
89 | echo "Internet connection detected"
90 | fi
91 |
92 | #remove old vara files before downloading new ones
93 | if [ -f $VARATHIRTY ]; then
94 | rm $VARATHIRTY
95 | fi
96 |
97 | if [ -f $VARAFILE ]; then
98 | rm $VARAFILE
99 | fi
100 |
101 | if [ -f $VARAEIGHTY ]; then
102 | rm $VARAEIGHTY
103 | fi
104 |
105 | if [ -f $VARAFORTY ]; then
106 | rm $VARAFORTY
107 | fi
108 |
109 | if [ -f $VARATWENTY ]; then
110 | rm $VARATWENTY
111 | fi
112 |
113 | if [ -f $VARAFM ]; then
114 | rm $VARAFM
115 | fi
116 |
117 | #remove old ARDOP files before downloading new ones
118 | if [ -f $THIRTY ]; then
119 | rm $THIRTY
120 | fi
121 |
122 | if [ -f $FILE ]; then
123 | rm $FILE
124 | fi
125 |
126 | if [ -f $EIGHTY ]; then
127 | rm $EIGHTY
128 | fi
129 |
130 | if [ -f $FORTY ]; then
131 | rm $FORTY
132 | fi
133 |
134 | if [ -f $TWENTY ]; then
135 | rm $TWENTY
136 | fi
137 |
138 | if [ -f $PACKET ]; then
139 | rm $PACKET
140 | fi
141 |
142 | #create file that has grid variable used in calculations
143 | touch $HOME/patmenu2/ardop-list/grid.txt
144 | MYGRID=$(grep locator $HOME/.config/pat/config.json | sed 's/.*": //;s/"//g;s/,//')
145 | echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt
146 | echo "LASTDL=List downloaded `date`" >> $HOME/patmenu2/ardop-list/grid.txt
147 |
148 | #download list to individual files.
149 | DL(){
150 | pat rmslist -s --mode ardop --force-download >> $FILE
151 | pat rmslist -s --band 80m --mode ardop --force-download >> $EIGHTY
152 | pat rmslist -s --band 40m --mode ardop --force-download >> $FORTY
153 | pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY
154 | pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY
155 | pat rmslist -s --mode packet --force-download >> $PACKET
156 |
157 | pat rmslist -s --mode vara --force-download >> $VARAFILE
158 | pat rmslist -s --band 80m --mode vara --force-download >> $VARAEIGHTY
159 | pat rmslist -s --band 40m --mode vara --force-download >> $VARAFORTY
160 | pat rmslist -s --band 20m --mode vara --force-download >> $VARATWENTY
161 | pat rmslist -s --band 30m --mode vara --force-download >> $VARATHIRTY
162 | pat rmslist -s --band 2m --mode varafm --force-download >> $VARAFM
163 | }
164 | DL
165 |
166 | if [ -f "$FILE" ]
167 | then
168 | echo $TODAY" RMS Gateway list download Success" >> $LOG
169 | echo;echo "RMS gateway list download success"
170 | else
171 | echo $TODAY" RMS Gateway list download FAIL" >> $LOG
172 | echo;echo "RMS gateway list failed to download"
173 | fi
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ardop-list/
2 | FA-functions.bkup
3 | config
4 |
--------------------------------------------------------------------------------
/891.km4ack.config:
--------------------------------------------------------------------------------
1 | #Config file for Pat Menu
2 | #20200429 KM4ACK
3 | MYCALLSIGN=KM4ACK
4 | MAP=usa
5 | RIGCONTROL=yes
6 | ARDOP="/home/pi/ardop/./piardopc 8515 plughw:1,0 plughw:1,0"
7 | ARDOPGUI="/home/pi/ardop/./piARDOP_GUI"
8 | DIREWOLF="direwolf -p"
9 | KISS="sudo /usr/sbin/kissattach /tmp/kisstnc"
10 | AXP=wl2k
11 | RIG="/usr/local/bin/rigctl -m 4"
12 | MODEHF=PKTUSB
13 | MODE2M=FM
14 | PORT=5050
15 | LOG=/home/pi/Documents/mylog.txt
16 | AMRRON=no
17 |
--------------------------------------------------------------------------------
/FA-functions:
--------------------------------------------------------------------------------
1 | #functions file for find ardop
2 | #20200425 km4ack
3 |
4 | MYPATH=$HOME/patmenu2
5 | MAIN=$MYPATH/./find2
6 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
7 | TEMP=$HOME/patmenu2/tempconfig.txt
8 | TODAY=$(date +%Y%m%d-%R)
9 | WHO=$(whoami)
10 | LASTDL=$(cat $MYPATH/ardop-list/ardoplist.txt | head -1)
11 | LOGO=$MYPATH/pmlogo.png
12 |
13 | source $MYPATH/config
14 |
15 |
16 |
17 | #--------------------------------
18 | # MANUAL Download List
19 | #--------------------------------
20 | DOWNLIST(){
21 | $MYPATH/getardoplist
22 | $MAIN &
23 | exit
24 | }
25 |
26 |
27 | #--------------------------------
28 | # AUTO Download List
29 | #--------------------------------
30 | AUTODOWN(){
31 | FILE=/run/user/$UID/cronbkup.txt
32 | crontab -l > $FILE
33 | HOURS=Disable,At-Boot,00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23
34 | MINS=00,15,30,45
35 |
36 | TEST=$(yad --center --wrap --width=350 --title="Auto Download" --text-align=center \
37 | --text="Please choose the time you would like to download the gateway list everyday" \
38 | --image $LOGO --window-icon=$LOGO --image-on-top \
39 | --button="Update:2" \
40 | --button="Cancel:1" \
41 | --form --separator="," --item-separator="," \
42 | --field="Choose the hour":CB $HOURS \
43 | --field="Choose the minutes":CB $MINS \
44 | )
45 |
46 | rc=$?
47 | if [[ $rc -eq 2 ]]; then
48 | echo "Updating Cron"
49 | HOUR=$(echo $TEST | awk -F ',' '{print $1}')
50 | MIN=$(echo $TEST | awk -F ',' '{print $2}')
51 | sed -i '/getardoplist/d' $FILE
52 | if [ $HOUR = 'At-Boot' ]; then
53 | echo "@reboot sleep 10 && $MYPATH/.getardoplist-cron" >> $FILE
54 | crontab $FILE
55 | echo "Your crontab has been updated. The gateway list"
56 | echo "will be downloaded daily at "$HOUR":"$MIN" hours"
57 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Auto Download set for $HOUR:$MIN daily" \
58 | --image $LOGO --window-icon=$LOGO --image-on-top
59 | $MAIN &
60 | rm $FILE
61 | exit
62 | elif [ $HOUR = 'Disable' ]; then
63 | sed -i s'/getardoplist-cron/d' $FILE
64 | crontab $FILE
65 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Auto Download Disabled" \
66 | --image $LOGO --window-icon=$LOGO --image-on-top
67 | $MAIN & exit
68 |
69 | else
70 |
71 | echo "$MIN $HOUR * * * $MYPATH/.getardoplist-cron" >> $FILE
72 | #echo $MIN" "$HOUR" * * * $MYPATH/.getardoplist-cron" >> $FILE
73 | crontab $FILE
74 | echo
75 | echo "Your crontab has been updated. The gateway list"
76 | echo "will be downloaded daily at "$HOUR":"$MIN" hours"
77 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Auto Download set for $HOUR:$MIN daily" \
78 | --image $LOGO --window-icon=$LOGO --image-on-top
79 | $MAIN &
80 | rm $FILE
81 | exit
82 | fi
83 | elif [[ $rc -eq 1 ]]; then
84 | echo "BYE"
85 | $MAIN &
86 | exit
87 | fi
88 | }
89 |
90 | #--------------------------------
91 | # GRID SEARCH
92 | #--------------------------------
93 | GRIDSEARCH(){
94 | OUTFILE=/run/user/$UID/tempardoplist.txt
95 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
96 | TEMP=/run/user/$UID/tempconfig.txt
97 | ARDOPLIST=$MYPATH/ardop-list
98 | VARALIST=$MYPATH/vara-list
99 | WHO=$(whoami)
100 | source $MYPATH/config #patmenu config file
101 | #check to make sure user has downloaded
102 | if [ ! -d "$MYPATH/ardop-list/" ]; then
103 | yad --title="No List" --width=400 --height=100 \
104 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
105 | --center --form --text="\r\rGateway list has NOT been downloaded.\rPlease download now\rRecommend setting auto download time" \
106 | --button="Download":2
107 | BUT=$?
108 | if [ $BUT = 2 ]; then
109 | $MYPATH/getardoplist
110 | $MAIN &
111 | exit
112 | elif [ $BUT = 252 ]; then
113 | exit
114 | fi
115 | fi
116 | SEARCHMENU(){
117 | #MENU
118 | BANDS="20|30|40|80|2M-70CM"
119 | SEARCH=$(yad --form --width=400 --text="Find Winlink Gateways" --text-align=center --center --title="Find ARDOP" --text-align=center \
120 | --separator="|" --item-separator="|" \
121 | --image=$LOGO --window-icon=$LOGO --image-on-top \
122 | --field="Choose Modem":CB "VARA|ARDOP" \
123 | --field="Grid to Search" "EM" \
124 | --field="Band to Search":CB "$BANDS" \
125 | --button="Search":2 \
126 | --button="Cancel":1)
127 | QUIT=$?
128 | MODEM=$(echo $SEARCH | awk -F "|" '{print $1}')
129 | GRID=$(echo $SEARCH | awk -F "|" '{print $2}')
130 | GRID=$(echo "${GRID^^}")
131 | BAND=$(echo $SEARCH | awk -F "|" '{print $3}')
132 |
133 | echo "Grid search is $GRID"
134 | echo "Band is $BAND"
135 |
136 | if [ $QUIT = 1 ]; then
137 | $MAIN &
138 | exit
139 | elif [ $QUIT = 252 ]; then
140 | exit
141 | fi
142 |
143 | ##############PACKET SEARCH######################
144 | if [ $QUIT = 2 ] && [ "$BAND" = '2M-70CM' ]; then
145 |
146 |
147 | #########START PACKET SECTION######################
148 |
149 |
150 | FILE=$MYPATH/ardop-list/packet.txt
151 | TEMP=/run/user/$UID/temppacket.txt
152 | TEMP1=/run/user/$UID/templist.txt
153 | TEMP2=/run/user/$UID/tempalias.txt
154 |
155 | echo "Grid search is $GRID"
156 |
157 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$TEMP" > /dev/null 2>&1
158 |
159 |
160 | INFO=$(PARSER='OFS="\n" {print $1, $2, $3, $4, $5, $6, $7, $9, $11}'
161 | MYTEMP=$TEMP2
162 | tail -1000 $TEMP | awk "$PARSER" | \
163 | yad --title="Search Results" --width=1100 --height=500 \
164 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
165 | --center --list --text="Search Results" \
166 | --column Call --column Grid --column Dist \
167 | --column Azm --column Mode --column Speed \
168 | --column Dial-Freq \
169 | --column Center-Freq --column Shortcut \
170 | --button=gtk-close \
171 | --button="Add Alias":2 > $MYTEMP)
172 | BUT=$?
173 |
174 |
175 | if [ "$BUT" = 2 ];then
176 | CALL=$(echo $INFO | awk -F "|" '{print $1}')
177 | SC=$(echo $INFO | awk -F "|" '{print $9}')
178 | FREQ=$(echo $SC | sed 's/.*=//')
179 | if [ $RIGCONTROL = 'no' ]; then
180 | SC=$(echo $SC | sed 's/[?].*$//')
181 | fi
182 |
183 | while read LINE; do
184 | CALL=$(echo $LINE | awk -F "|" '{print $1}')
185 | SC=$(echo $LINE | awk -F "|" '{print $9}')
186 | FREQ=$(echo $SC | sed 's/.*=//')
187 | if [ $RIGCONTROL = 'no' ]; then
188 | SC=$(echo $SC | sed 's/[?].*$//')
189 | fi
190 |
191 | SC=$(echo $SC | sed 's/packet/ax25/')
192 |
193 | jq '.connect_aliases += {'\""$CALL-$BAND"M"-$FREQ"\"' : '\"$SC\"'}' $CONFIG > $TEMP
194 | cp $TEMP $CONFIG
195 | rm $TEMP
196 | done < $TEMP2
197 | sudo killall pat
198 | sudo systemctl start pat@$WHO
199 |
200 | yad --title="ADDED" --width=300 --height=100 \
201 | --image $LOGO --window-icon=$LOGO --image-on-top \
202 | --center --form --text="$CALL-$FREQ added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \
203 | --button=gtk-ok
204 | SEARCHMENU
205 | fi
206 | SEARCHMENU
207 | fi
208 | ##############END PACKET SECTION################
209 |
210 | #determine which modem was chosen
211 | if [ "$MODEM" = 'ARDOP' ]; then
212 |
213 | #############ARDOP SEARCH####################
214 |
215 | OUTFILE2=/run/user/$UID/tempardop2.txt
216 |
217 | if [ $BAND = 20 ];then
218 | FILE=$ARDOPLIST/20mardoplist.txt
219 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
220 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
221 | elif [ $BAND = 30 ];then
222 | FILE=$ARDOPLIST/30mardoplist.txt
223 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
224 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
225 | elif [ $BAND = 40 ];then
226 | FILE=$ARDOPLIST/40mardoplist.txt
227 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
228 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
229 | elif [ $BAND = 80 ];then
230 | FILE=$ARDOPLIST/80mardoplist.txt
231 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
232 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
233 | echo "80 done"
234 | fi
235 |
236 | INFO=$(PARSER='OFS="\n" {print $1, $2, $3, $4, $5, $6, $7, $9, $11}'
237 | MYTEMP=/run/user/$UID/mytemptestardoplist
238 | tail -50 $OUTFILE | awk "$PARSER" | \
239 | yad --title="Search Results" --width=1100 --height=500 \
240 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
241 | --center --list --text="Search Results" \
242 | --column Call --column Grid --column Dist \
243 | --column Azm --column Mode --column Speed \
244 | --column Dial-Freq \
245 | --column Center-Freq --column Shortcut \
246 | --button=gtk-close \
247 | --button="Add Alias":2 > $MYTEMP)
248 | BUT=$?
249 | if [ "$BUT" = 2 ];then
250 | CALL=$(echo $INFO | awk -F "|" '{print $1}')
251 | SC=$(echo $INFO | awk -F "|" '{print $9}')
252 | FREQ=$(echo $SC | sed 's/.*=//')
253 | if [ $RIGCONTROL = 'no' ]; then
254 | SC=$(echo $SC | sed 's/[?].*$//')
255 | fi
256 |
257 | while read LINE; do
258 | CALL=$(echo $LINE | awk -F "|" '{print $1}')
259 | SC=$(echo $LINE | awk -F "|" '{print $9}' | sed 's/\&/\&/')
260 | FREQ=$(echo $SC | sed 's/.*=//')
261 | if [ $RIGCONTROL = 'no' ]; then
262 | SC=$(echo $SC | sed 's/[?].*$//')
263 | fi
264 | jq '.connect_aliases += {'\""$CALL-$BAND"M"-""ARDOP"\"' : '\"$SC\"'}' $CONFIG > $TEMP
265 | cp $TEMP $CONFIG
266 | rm $TEMP
267 | done < /run/user/$UID/mytemptestardoplist
268 | sudo killall pat
269 | sudo systemctl start pat@$WHO
270 |
271 | if [ -z "$CALL" ]; then
272 | yad --title="No Selection" --width=300 --height=100 \
273 | --image $LOGO --window-icon=$LOGO --image-on-top \
274 | --center --form --text="No station was selected\r Please try again" \
275 | --button=gtk-ok
276 | $MAIN &
277 | exit
278 | fi
279 |
280 | yad --title="ADDED" --width=300 --height=100 \
281 | --image $LOGO --window-icon=$LOGO --image-on-top \
282 | --center --form --text="Alias added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \
283 | --button=gtk-ok
284 | SEARCHMENU
285 | fi
286 |
287 | elif [ "$MODEM" = 'VARA' ]; then
288 | #############VARA SEARCH####################
289 |
290 | OUTFILE2=/run/user/$UID/tempardop2.txt
291 |
292 | if [ $BAND = 20 ];then
293 | FILE=$VARALIST/20mvaralist.txt
294 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
295 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
296 | elif [ $BAND = 30 ];then
297 | FILE=$VARALIST/30mvaralist.txt
298 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
299 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
300 | elif [ $BAND = 40 ];then
301 | FILE=$VARALIST/40mvaralist.txt
302 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
303 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
304 | elif [ $BAND = 80 ];then
305 | FILE=$VARALIST/80mvaralist.txt
306 | cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
307 | sed -i 's/&/&/g' $OUTFILE > /dev/null 2>&1
308 | echo "80 done"
309 | fi
310 |
311 | #remove outfile2 if it exist
312 | if [ -f $OUTFILE2 ]; then
313 | rm $OUTFILE2
314 | fi
315 |
316 | #add speed to line if not in list already
317 | while read -r line
318 | do
319 | CHECK=$(echo $line | awk '{print $6}')
320 | if [ "$CHECK" = 500 ] || [ "$CHECK" = 2750 ]; then
321 | echo $line >> $OUTFILE2
322 | else
323 | echo $line | sed 's/VARA/VARA 500/' >> $OUTFILE2
324 | fi
325 | done < $OUTFILE
326 |
327 | INFO=$(PARSER='OFS="\n" {print $1, $2, $3, $4, $5, $6, $7, $9, $11}'
328 | MYTEMP=/run/user/$UID/mytemptestardoplist
329 | tail -50 $OUTFILE2 | awk "$PARSER" | \
330 | yad --title="Search Results" --width=1100 --height=500 \
331 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
332 | --center --list --text="Search Results" \
333 | --column Call --column Grid --column Dist \
334 | --column Azm --column Mode --column Speed \
335 | --column Dial-Freq \
336 | --column Center-Freq --column Shortcut \
337 | --button=gtk-close \
338 | --button="Add Alias":2 > $MYTEMP)
339 | BUT=$?
340 | if [ "$BUT" = 2 ];then
341 | CALL=$(echo $INFO | awk -F "|" '{print $1}')
342 | SC=$(echo $INFO | awk -F "|" '{print $9}')
343 | FREQ=$(echo $SC | sed 's/.*=//')
344 | if [ $RIGCONTROL = 'no' ]; then
345 | SC=$(echo $SC | sed 's/[?].*$//')
346 | fi
347 |
348 | while read LINE; do
349 | CALL=$(echo $LINE | awk -F "|" '{print $1}')
350 | SC=$(echo $LINE | awk -F "|" '{print $9}' | sed 's/\&/\&/')
351 | FREQ=$(echo $SC | sed 's/.*=//')
352 | if [ $RIGCONTROL = 'no' ]; then
353 | SC=$(echo $SC | sed 's/[?].*$//')
354 | fi
355 | jq '.connect_aliases += {'\""$CALL-$BAND"M"-""VARA"\"' : '\"$SC\"'}' $CONFIG > $TEMP
356 | cp $TEMP $CONFIG
357 | rm $TEMP
358 | done < /run/user/$UID/mytemptestardoplist
359 | sudo killall pat
360 | sudo systemctl start pat@$WHO
361 |
362 | if [ -z "$CALL" ]; then
363 | yad --title="No Selection" --width=300 --height=100 \
364 | --image $LOGO --window-icon=$LOGO --image-on-top \
365 | --center --form --text="No station was selected\r Please try again" \
366 | --button=gtk-ok
367 | $MAIN &
368 | exit
369 | fi
370 |
371 | yad --title="ADDED" --width=300 --height=100 \
372 | --image $LOGO --window-icon=$LOGO --image-on-top \
373 | --center --form --text="Alias added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \
374 | --button=gtk-ok
375 | SEARCHMENU
376 | fi
377 | fi #close modem if/then statement
378 | SEARCHMENU
379 | }
380 | SEARCHMENU
381 | }
382 | #--------------------------------
383 | # Open Map
384 | #--------------------------------
385 | MAP(){
386 |
387 | if [ "$MAP" = "usa" ]; then
388 | MAP=$MYPATH/grid-map.pdf
389 | elif [ "$MAP" = "world" ]; then
390 | MAP=$MYPATH/worldgridmap.pdf
391 | fi
392 | xdg-open $MAP
393 | }
394 | #--------------------------------
395 | # Alternate Grid Download
396 | #--------------------------------
397 |
398 | #THIS FUNCTION DEPRECATED BUT LEFT FOR REFERENCE 11MARCH2022
399 |
400 | #make new dir in pat menu dir if needed
401 | mkdir -p $HOME/patmenu2/alt-ardop-list
402 |
403 | ALTGRID(){
404 | #check internet connection
405 | echo "Please wait while we check your internet connection"
406 | echo "This may take up to a minute"
407 | wget -q --tries=5 --timeout=10 --spider http://google.com #| yad --center --progress --pulsate --timeout-indicator=top --auto-close --no-buttons --text="Checking internet connection"
408 | if [[ $? -eq 0 ]]; then
409 | #yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Connection Detected" &
410 | echo "Connection detected"
411 | else
412 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="You are not connected to the internet"
413 | exit
414 | fi
415 |
416 | #Create temp config file to use for downloads
417 | MAINFILE=$XDG_CONFIG_HOME/pat/config.json
418 | TEMPFILE=/run/user/$UID/config.json
419 | cp $MAINFILE $TEMPFILE
420 |
421 | GRID=$(yad --form --width=420 --text-align=center --center --title="Pat Log In/Out" --text-align=center \
422 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
423 | --text="Pat Log In/Out by KM4ACK" \
424 | --field="Alt Grid" "" \
425 | --button="Download Gateway List":2 \
426 | --button="Cancel":1)
427 | BUT=$?
428 | if [ $BUT = 252 ]; then
429 | exit
430 | elif [ $BUT = 1 ]; then
431 | $MAIN &
432 | exit
433 | fi
434 | GRID=$(echo $GRID | awk -F "|" '{print $1}')
435 |
436 | sed -i "s/\"locator\":.*/\"locator\": \"$GRID\",/" $TEMPFILE
437 |
438 | #Download the files
439 | FOLDER=$HOME/patmenu2/alt-ardop-list/ardop-list-$GRID
440 | mkdir -p $FOLDER
441 | echo "downloading....please wait"
442 | DL(){
443 | pat --config /run/user/$UID/config.json rmslist -s --band 80m --mode ardop --force-download > $FOLDER/80mardoplist.txt
444 | pat --config /run/user/$UID/config.json rmslist -s --band 40m --mode ardop --force-download > $FOLDER/40mardoplist.txt
445 | pat --config /run/user/$UID/config.json rmslist -s --band 30m --mode ardop --force-download > $FOLDER/30mardoplist.txt
446 | pat --config /run/user/$UID/config.json rmslist -s --band 20m --mode ardop --force-download > $FOLDER/20mardoplist.txt
447 | pat --config /run/user/$UID/config.json rmslist -s --mode packet --force-download > $FOLDER/packet.txt
448 | yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Downloads Done" &
449 | }
450 | DL | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center \
451 | --text="Downloading....This takes ~30 seconds\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the download."
452 | rm $TEMPFILE
453 | $MAIN &
454 | exit
455 | }
456 | #--------------------------------
457 | # Load Alternate Grid List
458 | #--------------------------------
459 |
460 | #THIS FUNCTION DEPRECATED BUT LEFT FOR REFERENCE 11MARCH2022
461 |
462 |
463 | LOADALTGRID(){
464 | OUTFILE=/run/user/$UID/alt-grid.list
465 |
466 | ls $HOME/patmenu2/alt-ardop-list > $OUTFILE
467 |
468 | LIST=$(PARSER='OFS="\n" {print $1}'
469 |
470 | tail -10 $OUTFILE | awk "$PARSER" | \
471 | yad --title="Load Packet List" --width=300 --height=500 \
472 | --image $LOGO --window-icon=$LOGO --image-on-top \
473 | --center --list --text="Choose List to Load" \
474 | --column List-to-Load \
475 | --button="Cancel":1 \
476 | --button="Load List":2 \
477 | --button="Delete All Lists":3)
478 | BUT=$?
479 | LIST=$(echo $LIST | awk -F "|" '{print $1}')
480 | echo $LIST
481 | if [ $BUT = 252 ]; then
482 | exit
483 | elif [ $BUT = 1 ]; then
484 | $MAIN &
485 | exit
486 | elif [ $BUT = 3 ]; then
487 | yad --title="Delete List" --width=100 --height=100 \
488 | --image $LOGO --window-icon=$LOGO --image-on-top \
489 | --center --text="Are You Sure?" \
490 | --button="YES":1 \
491 | --button="NO":2
492 | BUT=$?
493 | if [ $BUT = 1 ]; then
494 | rm -rf $HOME/patmenu2/alt-ardop-list
495 | yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Alt Lists Deleted"
496 | $MAIN &
497 | exit
498 | fi
499 | $MAIN &
500 | exit
501 | fi
502 | #backup home grid before loading alt grid
503 | HOMEGRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"//g;s/locator://;s/,//;s/ //g')
504 | if [ ! -d $HOME/patmenu2/alt-ardop-list/ardop-list-$HOMEGRID ]; then
505 | echo "Backing up home grid"
506 | mkdir -p $HOME/patmenu2/alt-ardop-list/ardop-list-$HOMEGRID
507 | cp $HOME/patmenu2/ardop-list/* $HOME/patmenu2/alt-ardop-list/ardop-list-$HOMEGRID
508 | fi
509 |
510 | #load alt grid
511 | cp -r $HOME/patmenu2/alt-ardop-list/$LIST/* $HOME/patmenu2/ardop-list/
512 | LIST=$(echo $LIST | sed 's/ardop-list-//')
513 | yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Grid $LIST Loaded"
514 | echo "GRID=$LIST" > $HOME/patmenu2/.grid
515 | $MAIN &
516 | exit
517 | }
518 |
519 | #--------------------------------
520 | # Recalculate Distance & Bearings
521 | #--------------------------------
522 |
523 | NEWCALC(){
524 | #Function to update the distance and bearing between
525 | #your current grid and the winlink gateways.
526 | #this is necessary because the calculations are initially
527 | #based on the grid in the pat config file at the time the
528 | #list is downloaded.
529 | #10MARCH2022 KM4ACK
530 |
531 | DIR=/run/user/$UID
532 | TMPFILE=$DIR/tempfile
533 | TMPFILE2=$DIR/tempfile2
534 | TMPFILE3=$DIR/tempfile3
535 | MYGRID=$(cat /run/user/$UID/gridinfo.txt | cut -c1-6)
536 |
537 | #backup current ARDOP lists
538 | BKDIR=$MYPATH/ardop-list/bkup-`date +%F.%H%M`
539 | mkdir -p $BKDIR
540 | cp -r $HOME/patmenu2/ardop-list/*.txt $BKDIR/
541 |
542 | #backup current VARA lists
543 | BKDIRVARA=$MYPATH/vara-list/bkup-`date +%F.%H%M`
544 | mkdir -p $BKDIRVARA
545 | cp -r $HOME/patmenu2/vara-list/*.txt $BKDIRVARA/
546 |
547 | MYGRID=$(yad --form --width=450 --text="Recalculate Distance and Bearings to Gateways\rThis takes 5-6 minutes to complete" \
548 | --text-align=center --center --title="Recalculate" --text-align=center --separator="|" --item-separator="|" \
549 | --image=$LOGO --window-icon=$LOGO --image-on-top \
550 | --field="Current Grid Square" "$MYGRID" \
551 | --button="Recalculate":2 \
552 | --button="Cancel":1)
553 | BUT=$?
554 | MYGRID=`echo $MYGRID | awk -F "|" '{print $1}'`
555 |
556 | if [ $BUT = 252 ]; then
557 | exit
558 | elif [ $BUT = 1 ]; then
559 | $MAIN &
560 | exit
561 | fi
562 |
563 | #create file that has grid variable used in calculations
564 | touch $HOME/patmenu2/ardop-list/grid.txt
565 | echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt
566 | echo "LASTDL=Recalculated `date`" >> $HOME/patmenu2/ardop-list/grid.txt
567 |
568 | MAIN(){
569 | echo "Recalculating ARDOP 20M List"
570 | RECALC 20mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
571 | --text="Recalculating ARDOP 20M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
572 |
573 | echo "Recalculating ARDOP 30M List"
574 | RECALC 30mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
575 | --text="Recalculating ARDOP 30M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
576 |
577 | echo "Recalculating ARDOP 40M List"
578 | RECALC 40mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
579 | --text="Recalculating ARDOP 40M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
580 |
581 | echo "Recalculating ARDOP 80M List"
582 | RECALC 80mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
583 | --text="Recalculating ARDOP 80M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
584 |
585 | echo "Recalculating Packet list"
586 | RECALC packet.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
587 | --text="Recalculating Packet List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
588 |
589 | echo "Recalculating Vara 20M List"
590 | RECALCVARA 20mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
591 | --text="Recalculating VARA 20M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
592 |
593 | echo "Recalculating Vara 30M List"
594 | RECALCVARA 30mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
595 | --text="Recalculating VARA 30M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
596 |
597 | echo "Recalculating Vara 40M List"
598 | RECALCVARA 40mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
599 | --text="Recalculating VARA 40M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
600 |
601 | echo "Recalculating Vara 80M List"
602 | RECALCVARA 80mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
603 | --text="Recalculating VARA 80M List\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the process\rand leave you with a corrupt list."
604 |
605 | yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="New Calculations Complete"
606 | }
607 |
608 | RECALC(){
609 | #This section recalculates the ARDOP lists and 2M Packet list
610 | FILE=$HOME/patmenu2/ardop-list/$1
611 | #check for and remove existing temp file
612 | if [ -f $TMPFILE3 ]; then
613 | rm $TMPFILE3
614 | fi
615 |
616 | #create temp list to work with and remove headers/blank lines
617 | cp $FILE $TMPFILE
618 | sed -i 's/.*information...//;s/.*succeeded.//;s/.*url//' $TMPFILE
619 | sed -i '/^$/d' $TMPFILE
620 |
621 |
622 |
623 | #read file, calculate new distance, and update
624 | while read LINE;
625 | do
626 | GRID=`echo $LINE | awk '{print $2}' | sed 's/\[//;s/\]//'`
627 | DISTANCE=`echo $LINE | awk '{print $3 }'`
628 | BEARING=`echo $LINE | awk '{print $4 }'`
629 | CALC=`/usr/bin/wwl $MYGRID $GRID`
630 | NEWDISTANCE=`echo $CALC | awk '{print $2}'`
631 | NEWBEARING=`echo $CALC | awk '{print $5}'`
632 | echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/;s/$BEARING/$NEWBEARING/" >> $TMPFILE2
633 | done < $TMPFILE
634 | rm $TMPFILE
635 |
636 | #pad distance with zeros for sorting
637 | while read LINE
638 | do
639 | DISTANCE=$(echo $LINE | awk '{ print $3 }')
640 | NEWDISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
641 | echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/" >> $TMPFILE3
642 | done < $TMPFILE2
643 | rm $TMPFILE2
644 |
645 | #sort list by distance
646 | sort -k3 -o $TMPFILE3 $TMPFILE3
647 |
648 | cp $TMPFILE3 $HOME/patmenu2/ardop-list/$1
649 | }
650 |
651 | ###########VARA Recalculate#######################
652 | RECALCVARA(){
653 | #This section recalculates the VARA lists.
654 | FILE=$HOME/patmenu2/vara-list/$1
655 | #check for and remove existing temp file
656 | if [ -f $TMPFILE3 ]; then
657 | rm $TMPFILE3
658 | fi
659 |
660 | #create temp list to work with and remove headers/blank lines
661 | cp $FILE $TMPFILE
662 | sed -i 's/.*information...//;s/.*succeeded.//;s/.*url//' $TMPFILE
663 | sed -i '/^$/d' $TMPFILE
664 |
665 |
666 |
667 | #read file, calculate new distance, and update
668 | while read LINE;
669 | do
670 | GRID=`echo $LINE | awk '{print $2}' | sed 's/\[//;s/\]//'`
671 | DISTANCE=`echo $LINE | awk '{print $3 }'`
672 | BEARING=`echo $LINE | awk '{print $4 }'`
673 | CALC=`/usr/bin/wwl $MYGRID $GRID`
674 | NEWDISTANCE=`echo $CALC | awk '{print $2}'`
675 | NEWBEARING=`echo $CALC | awk '{print $5}'`
676 | echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/;s/$BEARING/$NEWBEARING/" >> $TMPFILE2
677 | done < $TMPFILE
678 | rm $TMPFILE
679 |
680 | #pad distance with zeros for sorting
681 | while read LINE
682 | do
683 | DISTANCE=$(echo $LINE | awk '{ print $3 }')
684 | NEWDISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
685 | echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/" >> $TMPFILE3
686 | done < $TMPFILE2
687 | rm $TMPFILE2
688 |
689 | #sort list by distance
690 | sort -k3 -o $TMPFILE3 $TMPFILE3
691 |
692 | cp $TMPFILE3 $HOME/patmenu2/vara-list/$1
693 | }
694 |
695 | #call main function
696 | MAIN
697 | #return to pat menu
698 | $MAIN
699 |
700 | }
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pat Menu 2
2 | Pat Menu is an easy to use menu system for Pat Winlink. It is designed to make it easier to get all of the needed componets loaded and ready to make a connection using Pat. It will also aid in finding ARDOP stations to connect to and shut down the modems once you wrap up along with many other features.
3 |
4 | # Install
5 | The preferred method of installation is with [Build a Pi](https://github.com/km4ack/pi-build). However, manual installation can be achieved by running the following command.
6 |
7 | git clone https://github.com/km4ack/patmenu2.git $HOME/patmenu2 && bash $HOME/patmenu2/setup
8 |
9 | # Video
10 | [](https://www.youtube.com/watch?v=rpVfRUBdZ7E "Pat Menu Install & Overview")
11 |
12 | # Issues
13 | Please report issues to https://github.com/km4ack/patmenu2/issues
14 |
--------------------------------------------------------------------------------
/auto-download:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #update cron to download ardop list
4 | #20191126 km4ack
5 |
6 | MYPATH=$HOME/patmenu2
7 | FILE=/run/user/$UID/cronbkup.txt
8 |
9 | crontab -l > $FILE
10 |
11 | HOURS=00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23
12 | MINS=00,15,30,45
13 |
14 | TEST=$(yad --center --wrap --width=250 --title="ARDOP Auto Download Setup" \
15 | --text="Please choose the time you would like to download the gateway list everyday" \
16 | --button="UPDATE:2" \
17 | --button="Exit:1" \
18 | --form --separator="," --item-separator="," \
19 | --field="Choose the hour":CB $HOURS \
20 | --field="Choose the minutes":CB $MINS \
21 | )
22 |
23 | rc=$?
24 | if [[ $rc -eq 2 ]]; then
25 | echo "Updating Cron"
26 | HOUR=$(echo $TEST | awk -F ',' '{print $1}')
27 | MIN=$(echo $TEST | awk -F ',' '{print $2}')
28 | sed -i '/getardoplist/d' $FILE
29 | echo $MIN" "$HOUR" * * * $MYPATH/getardoplist" >> $FILE
30 | crontab $FILE
31 | echo
32 | echo "Your crontab has been updated. The gateway list"
33 | echo "will be downloaded daily at "$HOUR":"$MIN" hours"
34 | sleep 5
35 | rm $FILE
36 | elif [[ $rc -eq 1 ]]; then
37 | echo "BYE"
38 | exit 0
39 | fi
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/autopat:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to perform auto connects to gateways
4 | #using pat winlink
5 | #20191015 KM4ACK
6 |
7 | MYPATH=$HOME/patmenu2
8 | LOGO=$MYPATH/pmlogo.png
9 | MAIN=$MYPATH/patmenu
10 |
11 | source $MYPATH/config
12 |
13 | if [ $RIGCONTROL == 'no' ]
14 | then
15 |
16 | yad --title="NO RIG CONTROL" --width=400 --height=100 \
17 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
18 | --center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \
19 | --button=gtk-ok
20 |
21 | exit
22 | fi
23 |
24 | #Check if FLRIG is running if user has it set in config file
25 | if [ "$RIGCONTROL" = 'yes' ]; then
26 | echo "rig control is on"
27 | FLRIG=$(echo $RIG | grep "\-m 4")
28 | if [ -z "$FLRIG" ]; then
29 | echo
30 | else
31 | FLRIG=$(pidof flrig)
32 | if [ -z "$FLRIG" ]; then
33 | yad --title="FAILED" --width=400 --height=100 \
34 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
35 | --center --form --text="Please start FLRIG and try again" \
36 | --button=gtk-ok
37 | exit
38 | fi
39 | fi
40 | fi
41 |
42 |
43 |
44 | if [ $AMRRON = "no" ]
45 | then
46 |
47 | DIRE=$(pidof direwolf)
48 | if [ -z "$DIRE" ]
49 | then
50 | echo
51 | else
52 | sudo killall direwolf kissattach
53 | fi
54 |
55 | PIARDOPC=$(pidof piardopc)
56 | if [ -z "$PIARDOPC" ]
57 | then
58 | echo
59 | else
60 | sudo killall piardopc ardop-GUI
61 | fi
62 |
63 | fi
64 |
65 | #clear any temp files from previous runs that might exist
66 | rm -rf $HOME/tempardop > /dev/null
67 |
68 | ARDOPLIST=$MYPATH/ardop-list/
69 |
70 | touch $LOG
71 |
72 | DATE=$(date)
73 |
74 | STARTRIG () {
75 | #start rigctld if not already
76 | PIDCTL=$(pidof rigctld)
77 | WHO=$(whoami)
78 | if [ -z "$PIDCTL" ]
79 | then
80 | CONTROL=$(echo $RIG | sed 's/rigctl/rigctld/')
81 | $CONTROL &
82 | sudo systemctl restart pat@$WHO
83 | fi
84 | }
85 |
86 | STARTRIG
87 |
88 | if [ -z "$PIDCTL" ]
89 | then
90 | STARTRIG
91 | fi
92 |
93 | SETRIG () {
94 |
95 | #Set USB Mode
96 | RIGUSB=$RIG" M $MODEHF 0"
97 |
98 | #check rig is in USB
99 | MODE=$($RIG m | grep $MODEHF)
100 |
101 | sleep 1
102 |
103 | MODECHECK() {
104 | #check rig is in correct mode
105 | MODE=$($RIG m | grep $MODEHF)
106 | }
107 |
108 | sleep 1
109 |
110 | if [ -z $MODE ]
111 | then
112 | $RIGUSB
113 | MODECHECK
114 | fi
115 |
116 | }
117 |
118 | SETRIG
119 |
120 | #Directions Function
121 | directions () {
122 | echo "The script needs two arguments to run."
123 | echo "It needs the distance that you want to try to connect"
124 | echo "and it needs the band you wish to use"
125 | echo "Bands available are 20, 30, 40, & 80"
126 | echo "The first argument is the distance"
127 | echo "and the second is the band. So to try all 40M"
128 | echo "stations in a 300km radius, you would enter"
129 | echo "autopat 300 40"
130 | exit 0
131 | }
132 |
133 | #check if distance is empty and give direction
134 | if [ -z "$1" ]
135 | then
136 | directions
137 | fi
138 |
139 | #check if band is empty and give direction
140 | if [ -z "$2" ]
141 | then
142 | directions
143 | fi
144 |
145 | #Check for min distance
146 | if [ -z "$3" ]
147 | then
148 | MIN=0
149 | else
150 | MIN=$3
151 | fi
152 |
153 | #take $2 as band to use
154 | if [ $2 = "20" ]
155 | then
156 | FILE=$ARDOPLIST"20mardoplist.txt"
157 | elif [ $2 = "30" ]
158 | then
159 | FILE=$ARDOPLIST"30mardoplist.txt"
160 | elif [ $2 = "40" ]
161 | then
162 | FILE=$ARDOPLIST"40mardoplist.txt"
163 | elif [ $2 = "80" ]
164 | then
165 | FILE=$ARDOPLIST"80mardoplist.txt"
166 | fi
167 |
168 | #Verify we have a list to work with
169 | test -f $FILE
170 | FILERESULT=$(echo $?)
171 | if [ $FILERESULT = "1" ]
172 | then
173 | echo "FILE DOESN'T EXIST."
174 | yad --title="NO LIST" --width=400 --height=100 \
175 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
176 | --center --form --text="\r\r\rNo list has been downloaded. Auto Pat has no data to work with. Please download the gateway list \
177 | and try again" \
178 | --button="Download List":2 \
179 | --button="Cancel":1
180 | BUT=$?
181 | if [ $BUT = 1 ]; then
182 | exit
183 | elif [ $BUT = 2 ]; then
184 | $MYPATH/getardoplist
185 | $MAIN &
186 | exit
187 | fi
188 | fi
189 |
190 | if [ $AMRRON = "no" ]
191 | then
192 | #start ardop-gui & piardopc
193 | $ARDOPGUI &
194 | $ARDOP &
195 | sleep 10
196 | fi
197 |
198 | #Pat Connection Function
199 | connect () {
200 | pat connect $CALL
201 | #Check if connection was successful
202 | RESULTS=$(echo $?)
203 | if [ $RESULTS = "0" ]
204 | then
205 | echo "A connection was made"
206 | echo $DATE" "$CALL" Success with autopat" >> $LOG
207 |
208 | yad --title="SUCCESS" --width=300 --height=100 \
209 | --image $LOGO --window-icon=$LOGO --image-on-top \
210 | --center --form --text="Successfully connected with $CALL" \
211 | --button=gtk-ok
212 |
213 | if [ $AMRRON = "no" ]
214 | then
215 | sudo killall piardopc piARDOP_GUI
216 | fi
217 | exit 0
218 | fi
219 | }
220 |
221 | #create temp dir & manipulate file
222 | mkdir -p $HOME/tempardop/
223 | #cat file, remove first few lines, remove blanks > NEWFILE NAME
224 | cat $FILE | tail -n +5 | grep '[^[:blank:]]' > $HOME/tempardop/tempardop.txt
225 |
226 | #pad with zeros
227 | while read LINE
228 | do DISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
229 | CALL=$(echo $LINE | awk '{ print $11 }')
230 | echo $DISTANCE" "$CALL >> $HOME/tempardop/tempardop1.txt
231 | done < $HOME/tempardop/tempardop.txt
232 |
233 | cat $HOME/tempardop/tempardop1.txt | sort >> $HOME/tempardop/sorted.txt
234 |
235 | echo "Will Attempt to Connect to This Station"
236 | #loop through file and find needed station info
237 | while read LINE
238 | do DISTANCE=$(echo $LINE | awk '{ print $1 }')
239 | CALL=$(echo $LINE | awk '{ print $2 }')
240 | if [ $DISTANCE -lt "$1" ] && [ $DISTANCE -gt "$MIN" ]
241 | then
242 | echo "Distance="$DISTANCE " Call="$CALL
243 | #call the connect funtion
244 | connect
245 | fi
246 | done < $HOME/tempardop/sorted.txt
247 |
248 |
249 | #remove temp directory & files
250 | rm -rf $HOME/tempardop
251 |
252 | if [ $AMRRON = "no" ]
253 | then
254 | #Stop ARDOP modem and gui
255 | sudo killall piardopc piARDOP_GUI
256 | fi
257 |
258 | yad --title="NO Connection" --width=400 --height=100 \
259 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
260 | --center --form --text="\r\r\r\rNo Winlink connection was made using the criteria you entered." \
261 | --button=gtk-ok
262 |
263 |
--------------------------------------------------------------------------------
/autopat-vara:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to perform auto connects to gateways
4 | #using pat winlink and the vara modem
5 | #20220831 KM4ACK
6 |
7 | #Most of this code was copied from the autopat script which does
8 | #the same thing using the ARDOP modem.
9 |
10 | MYPATH=$HOME/patmenu2
11 | LOGO=$MYPATH/pmlogo.png
12 | MAIN=$MYPATH/patmenu
13 |
14 | source $MYPATH/config
15 |
16 | #verify we have rig control
17 | if [ $RIGCONTROL == 'no' ]
18 | then
19 |
20 | yad --title="NO RIG CONTROL" --width=400 --height=100 \
21 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
22 | --center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \
23 | --button=gtk-ok
24 |
25 | exit
26 | fi
27 |
28 | #Check if FLRIG is running if user has it set in config file
29 | if [ "$RIGCONTROL" = 'yes' ]; then
30 | FLRIG=$(echo $RIG | grep "\-m 4")
31 | if [ -z "$FLRIG" ]; then
32 | echo
33 | else
34 | FLRIG=$(pidof flrig)
35 | if [ -z "$FLRIG" ]; then
36 | yad --title="FAILED" --width=400 --height=100 \
37 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
38 | --center --form --text="Please start FLRIG and try again" \
39 | --button=gtk-ok
40 | exit
41 | fi
42 | fi
43 | fi
44 |
45 | #clear any temp files from previous runs that might exist
46 | rm -rf $HOME/tempardop > /dev/null
47 |
48 | VARALIST=$MYPATH/vara-list/
49 |
50 | touch $LOG
51 |
52 | DATE=$(date)
53 |
54 | STARTRIG () {
55 | #start rigctld & restart pat
56 | PIDCTL=$(pidof rigctld)
57 | WHO=$(whoami)
58 | if [ -z "$PIDCTL" ]
59 | then
60 | CONTROL=$(echo $RIG | sed 's/rigctl/rigctld/')
61 | $CONTROL &
62 | sudo systemctl restart pat@$WHO
63 | fi
64 | }
65 |
66 | STARTRIG
67 |
68 | if [ -z "$PIDCTL" ]
69 | then
70 | STARTRIG
71 | fi
72 |
73 | SETRIG () {
74 | #Set Mode for rigcontrol
75 | $RIG M $MODEHF
76 | }
77 | SETRIG
78 |
79 | #Directions Function
80 | directions () {
81 | echo "The script needs two arguments to run."
82 | echo "It needs the distance that you want to try to connect"
83 | echo "and it needs the band you wish to use"
84 | echo "Bands available are 20, 30, 40, & 80"
85 | echo "The first argument is the distance"
86 | echo "and the second is the band. So to try all 40M"
87 | echo "stations in a 300km radius, you would enter"
88 | echo "autopat 300 40"
89 | exit 0
90 | }
91 |
92 | #check if distance is empty and give direction
93 | if [ -z "$1" ]
94 | then
95 | directions
96 | fi
97 |
98 | #check if band is empty and give direction
99 | if [ -z "$2" ]
100 | then
101 | directions
102 | fi
103 |
104 | #Check for min distance
105 | if [ -z "$3" ]
106 | then
107 | MIN=0
108 | else
109 | MIN=$3
110 | fi
111 |
112 | #take $2 as band to use
113 | if [ $2 = "20" ]
114 | then
115 | FILE=$VARALIST"20mvaralist.txt"
116 | elif [ $2 = "30" ]
117 | then
118 | FILE=$VARALIST"30mvaralist.txt"
119 | elif [ $2 = "40" ]
120 | then
121 | FILE=$VARALIST"40mvaralist.txt"
122 | elif [ $2 = "80" ]
123 | then
124 | FILE=$VARALIST"80mvaralist.txt"
125 | fi
126 |
127 | #Verify we have a list to work with
128 | test -f $FILE
129 | FILERESULT=$(echo $?)
130 | if [ $FILERESULT = "1" ]
131 | then
132 | echo "FILE DOESN'T EXIST."
133 | yad --title="NO LIST" --width=400 --height=100 \
134 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
135 | --center --form --text="\r\r\rNo list has been downloaded. Auto Pat has no data to work with. Please download the gateway list \
136 | and try again" \
137 | --button="Download List":2 \
138 | --button="Cancel":1
139 | BUT=$?
140 | if [ $BUT = 1 ]; then
141 | exit
142 | elif [ $BUT = 2 ]; then
143 | $MYPATH/getardoplist
144 | $MAIN &
145 | exit
146 | fi
147 | fi
148 |
149 | if [ $AMRRON = "no" ]
150 | then
151 | #start varaHF modem
152 | echo "Starting VARA-HF modem"
153 | /usr/local/bin/wine $HOME/.wine/drive_c/VARA/VARA.exe > /dev/null 2>&1 &
154 | echo "standby while the modem starts....."
155 | sleep 10 #give vara time to start
156 | fi
157 |
158 | #Pat Connection Function
159 | connect () {
160 | pat connect $CALL
161 | #Check if connection was successful
162 | RESULTS=$(echo $?)
163 | if [ $RESULTS = "0" ]
164 | then
165 | echo "A connection was made"
166 | echo $DATE" "$CALL" Success with autopat" >> $LOG
167 | CALL=$(echo "$CALL" | sed 's/&/ /')
168 |
169 | yad --title="SUCCESS" --width=300 --height=100 \
170 | --image $LOGO --window-icon=$LOGO --image-on-top \
171 | --center --form --text="Successfully connected!\r$CALL\r\rSee mylog in documents\rdirectory for more details." \
172 | --button=gtk-ok
173 |
174 | if [ $AMRRON = "no" ]
175 | then
176 | sudo killall direwolf piardopc kissattach piARDOP_GUI rigctld > /dev/null 2>&1
177 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
178 | kill -9 $VARA > /dev/null 2>&1
179 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
180 | kill -9 $VARA > /dev/null 2>&1
181 | fi
182 | exit 0
183 | fi
184 | }
185 |
186 | #create temp dir & manipulate file
187 | mkdir -p $HOME/tempardop/
188 | #cat file, remove first few lines, remove blanks > NEWFILE NAME
189 | cat $FILE | tail -n +5 | grep '[^[:blank:]]' > $HOME/tempardop/tempardop.txt
190 |
191 | #add speed to line if not in list already
192 | #otherwise the URL is wrong
193 | while read -r line
194 | do
195 | CHECK=$(echo $line | awk '{print $6}')
196 | if [ "$CHECK" = 500 ] || [ "$CHECK" = 2750 ]; then
197 | echo $line >> $HOME/tempardop/temp.txt
198 | else
199 | echo $line | sed 's/VARA/VARA 500/' >> $HOME/tempardop/temp.txt
200 | fi
201 | done < $HOME/tempardop/tempardop.txt
202 | cp $HOME/tempardop/temp.txt $HOME/tempardop/tempardop.txt
203 |
204 | #pad with zeros
205 | while read LINE
206 | do DISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
207 | CALL=$(echo $LINE | awk '{ print $11 }')
208 | echo $DISTANCE" "$CALL >> $HOME/tempardop/tempardop1.txt
209 | done < $HOME/tempardop/tempardop.txt
210 |
211 | cat $HOME/tempardop/tempardop1.txt | sort >> $HOME/tempardop/sorted.txt
212 |
213 | echo "Will Attempt to Connect to This Station"
214 | #loop through file and find needed station info
215 | while read LINE
216 | do DISTANCE=$(echo $LINE | awk '{ print $1 }')
217 | CALL=$(echo $LINE | awk '{ print $2 }')
218 | if [ $DISTANCE -lt "$1" ] && [ $DISTANCE -gt "$MIN" ]
219 | then
220 | echo "Distance="$DISTANCE " Call="$CALL
221 | #call the connect funtion
222 | connect
223 | fi
224 | done < $HOME/tempardop/sorted.txt
225 |
226 |
227 | #remove temp directory & files
228 | rm -rf $HOME/tempardop
229 |
230 | if [ $AMRRON = "no" ]
231 | then
232 | sudo killall direwolf piardopc kissattach piARDOP_GUI rigctld > /dev/null 2>&1
233 | sudo rfcomm release /dev/rfcomm0 > /dev/null 2>&1
234 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
235 | kill -9 $VARA > /dev/null 2>&1
236 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
237 | kill -9 $VARA > /dev/null 2>&1
238 |
239 | fi
240 |
241 | yad --title="NO Connection" --width=400 --height=100 \
242 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
243 | --center --form --text="\r\r\r\rNo Winlink connection was made using the criteria you entered." \
244 | --button=gtk-ok
245 |
246 |
--------------------------------------------------------------------------------
/cat-functions:
--------------------------------------------------------------------------------
1 | #function file for patmenu 2 catalog
2 | #20200430 km4ack
3 |
4 |
5 | MYPATH=$HOME/patmenu2
6 | LOGO=$MYPATH/pmlogo.png
7 | MAIN=$MYPATH/./catalog
8 | PATCONFIG=$XDG_CONFIG_HOME/pat/config.json
9 |
10 | #get callsign from pat config file
11 | CALLSIGN=$(cat $PATCONFIG | grep -m 1 mycall | sed 's/\"mycall\": \"//' | sed 's/\",//' | sed -e 's/^\s*//' | tr '[:lower:]' '[:upper:]')
12 |
13 |
14 | #COMPOSE EMAIL Function
15 | COMPOSE () {
16 | echo "${BODY}" | pat compose ${TO} -s "$SUBJECT"
17 | #give user some feedback
18 | echo "Your request has been posted to the outbox of Pat Winlink"
19 | echo "Please go to Pat and initiate a connection to send the request"
20 | yad --no-buttons --timeout=5 --center --timeout-indicator=top --title="POSTED" --text-align=center --width="300" height="300" \
21 | --text="Message Posted\rTo Outbox\r\rPlease go to Winlink and\rmake a connection\rto complete the\rrequest."
22 | $MAIN
23 | exit
24 | }
25 |
26 |
27 |
28 | GATEWAY(){
29 | GATE=$(yad --form --width=420 --text-align=center --center --title="Pat Catalog" --text-align=center \
30 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
31 | --text="Pat Catalog by KM4ACK" \
32 | --field="Gateway List":CB "ARDOP|PACKET")
33 | BUT=$?
34 |
35 | if [ $BUT = 252 ]; then
36 | exit
37 | fi
38 |
39 | GATE=$(echo $GATE | awk -F "|" '{print $1}')
40 |
41 | if [ -z $GATE ]; then
42 | $MAIN &
43 | exit
44 | fi
45 |
46 | if [ "$GATE" = ARDOP ]; then
47 | echo ARDOP
48 | TO="INQUIRY"
49 | SUBJECT="REQUEST"
50 | BODY="PUB_ARDOP"
51 | COMPOSE
52 | elif [ "$GATE" = PACKET ]; then
53 | echo PACKET
54 | TO="INQUIRY"
55 | SUBJECT="REQUEST"
56 | BODY="PUB_PACKET"
57 | COMPOSE
58 | fi
59 | }
60 |
61 | WEATHER(){
62 | WEATHER=$(yad --form --width=420 --text-align=center --center --title="Pat Catalog" --text-align=center \
63 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
64 | --text="Pat Catalog by KM4ACK" \
65 | --field="Weather Report":CB "GPS Weather|City Weather|GRIB Files")
66 | BUT=$?
67 | if [ $BUT = 252 ]; then
68 | exit
69 | fi
70 |
71 | WEATHER=$(echo $WEATHER | awk -F "|" '{print $1}')
72 |
73 | if [ -z "$WEATHER" ]; then
74 | $MAIN &
75 | exit
76 | fi
77 |
78 | if [ "$WEATHER" = 'GPS Weather' ]; then
79 | TMPFILE=/run/user/$UID/gps-data.txt
80 | gpxlogger > $TMPFILE &
81 | CGPSPID=$(echo $!)
82 | sleep 2
83 | kill $CGPSPID
84 |
85 | DATA=$(grep lat= $TMPFILE | head -1)
86 | LAT=$(echo $DATA | awk '{print $2}' | sed 's/"//g;s/lat=//')
87 | LONG=$(echo $DATA | awk '{print $3}' | sed 's/"//g;s/lon=//;s/>//')
88 |
89 | TO="SMTP:query@saildocs.com"
90 | SUBJECT=""
91 | BODY="https://forecast.weather.gov/MapClick.php?lat="$LAT"&lon="$LONG"&unit=0&lg=english&FcstType=text&TextType=1"
92 | COMPOSE
93 | elif [ "$WEATHER" = 'City Weather' ]; then
94 | FILE=$MYPATH/weather.txt
95 | PARSER='OFS="\n" {print $1, $2, $3}'
96 | CITY=$(tail -76 $FILE | awk "$PARSER" | \
97 | yad --title="Search Results" --width=500 --height=500 \
98 | --image $LOGO --window-icon=$LOGO --image-on-top \
99 | --center --checklist --list \
100 | --column Pick --column ID --column Area \
101 | --button="Choose":2)
102 |
103 | CITY=$(echo $CITY | awk -F "|" '{print $2}')
104 |
105 | if [ -z "$CITY" ]; then
106 | $MAIN &
107 | exit
108 | fi
109 |
110 | TO="INQUIRY"
111 | SUBJECT="REQUEST"
112 | BODY=$CITY
113 | COMPOSE
114 | elif [ "$WEATHER" = 'GRIB Files' ]; then
115 | echo "Need GRIB Files"
116 | FILE=/run/user/$UID
117 | QUESTION(){
118 | DEGREE=$(yad --center --wrap --width=350 --title="Auto Download" --text-align=center \
119 | --text="How many degrees would you like" \
120 | --form --separator="|" --item-separator="|" \
121 | --image $LOGO --window-icon=$LOGO --image-on-top \
122 | --field="Degrees":CB "2|6|10" \
123 | --button="Cancel:1" \
124 | --button="Continue:2")
125 | BUT=$?
126 | if [ $BUT = 1 ] || [ -z "$BUT" ]; then
127 | $MAIN &
128 | exit
129 | elif [ $BUT = 252 ]; then
130 | exit
131 | fi
132 |
133 | ANS=$(echo $DEGREE | awk -F "|" '{print $1}')
134 | echo $ANS
135 |
136 | if [ $ANS = "10" ]; then
137 | AREA=5
138 | echo "aree=5"
139 | elif [ $ANS = "6" ]; then
140 | AREA=3
141 | elif [ $ANS = "2" ]; then
142 | AREA=1
143 | fi
144 |
145 | GPS=$(gpspipe -r -n 10 | grep G\.GGA)
146 |
147 | LAT=$(echo $GPS | awk -F "," '{printf "%.0f \n", $3 }' | cut -c1-2)
148 | LATD=$(echo $GPS | awk -F "," '{print $4}')
149 | LON=$(echo $GPS | awk -F "," '{printf "%.0f \n", $5 }' | cut -c1-2)
150 | LOND=$(echo $GPS | awk -F "," '{print $6}')
151 |
152 | #do some math
153 | let NEWLATADD=$LAT+$AREA
154 | let NEWLONADD=$LON+$AREA
155 | let NEWLATSUB=$LAT-$AREA
156 | let NEWLONSUB=$LON-$AREA
157 |
158 | GRIBFILE=$FILE/gribtemp
159 | GRIBDATA () {
160 | yad --height=600 --width=400 --center --list --checklist --column=Request --column=Product --separator="," \
161 | --text "Select the data to request." --title="GRIB DATA REQUEST" \
162 | --button="Exit:1" --button="Request Selected:2" < $MYPATH/griblist > $GRIBFILE
163 |
164 | BUTTON=$?
165 |
166 | if [ $BUTTON = "252" ]; then
167 | exit
168 | elif [ $BUTTON = "1" ]; then
169 | $MAIN &
170 | exit
171 | fi
172 |
173 | #echo "button = "$BUTTON
174 |
175 | };export -f GRIBDATA
176 |
177 | GRIBDATA
178 |
179 | sed -i 's/TRUE,//' $GRIBFILE
180 |
181 | var=$(cat $GRIBFILE)
182 | var1=$(echo $var | sed 's/ //g' | sed 's/,*$//')
183 | rm $GRIBFILE
184 |
185 | #example of correct format
186 | # send gfs:40N,60N,140W,120W|2,2|24,48,72|PRESS,WIND
187 |
188 | TO=query@saildocs.com
189 | SUBJECT=REQUEST
190 | BODY=$(echo "send gfs:"$NEWLATSUB$LATD","$NEWLATADD$LATD","$NEWLONADD$LOND","$NEWLONSUB$LOND"|2,2|24,48,72|"$var1)
191 | COMPOSE
192 | }
193 | QUESTION
194 |
195 | exit
196 | fi
197 | exit
198 | }
199 |
200 |
201 |
202 |
203 |
204 | POSITION(){
205 | POST=$(yad --form --width=420 --text-align=center --center --title="Position" --text-align=center \
206 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
207 | --text="Position Reports by KM4ACK" \
208 | --field="Choose":CB "Post Position|Single Station Request|All Nearby Stations|100 Mobile Stations" \
209 | --field="Enter Call Below ONLY for Single Station Requests":LBL \
210 | --field="Call Sign-SSID" \
211 | --field="Comment for Post Position" \
212 | --button="Main Menu":1 \
213 | --button="Continue":2)
214 |
215 | QUIT=$?
216 |
217 | if [ $QUIT = 1 ]; then
218 | $MAIN &
219 | exit
220 | elif [ $QUIT = 252 ]; then
221 | exit
222 | fi
223 |
224 | REPORT=$(echo $POST | awk -F "|" '{print $1}')
225 |
226 | if [ "$REPORT" = "Post Position" ]; then
227 | echo "posting position"
228 | COMMENT=$(echo $POST | awk -F "|" '{print $4}')
229 | pat position -c "$COMMENT" | yad --center --pulsate --progress --auto-close --text="Getting GPS Data" --no-buttons &
230 | yad --center --timeout=3 --timeout-indicator=top --no-buttons \
231 | --text="Position posted to\rPat Winlink Outbox"
232 | $MAIN &
233 | exit
234 | elif [ "$REPORT" = "Single Station Request" ]; then
235 | CALL=$(echo $POST | awk -F "|" '{print $3}')
236 | TO="QTH"
237 | SUBJECT="POSITION REQUEST"
238 | BODY=$CALL
239 | COMPOSE
240 | elif [ "$REPORT" = "All Nearby Stations" ]; then
241 | TO="INQUIRY"
242 | SUBJECT="REQUEST"
243 | BODY="WL2K_NEARBY"
244 | COMPOSE
245 | elif [ "$REPORT" = "100 Mobile Stations" ]; then
246 | TO="INQUIRY"
247 | SUBJECT="REQUEST"
248 | BODY="WL2K_MOBILES"
249 | COMPOSE
250 | fi
251 | }
252 |
253 | PROPAGATION(){
254 | PROP=$(yad --form --width=420 --text-align=center --center --title="Propagation" --text-align=center \
255 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
256 | --text="Propagation Reports by KM4ACK" \
257 | --field="Choose Report":CB "3 Day Propagation Report|Daily WWV Report" \
258 | --button="Main Menu":1 \
259 | --button="Continue":2)
260 | QUIT=$?
261 | REPORT=$(echo $PROP | awk -F "|" '{print $1}')
262 |
263 | if [ $QUIT = 1 ]; then
264 | $MAIN &
265 | exit
266 | elif [ $QUIT = 252 ]; then
267 | exit
268 | fi
269 |
270 | if [ "$REPORT" = "3 Day Propagation Report" ]; then
271 | TO="INQUIRY"
272 | SUBJECT="REQUEST"
273 | BODY="PROP_3DAY"
274 | COMPOSE
275 | elif [ "$REPORT" = "Daily WWV Report" ]; then
276 | TO="INQUIRY"
277 | SUBJECT="REQUEST"
278 | BODY="PROP_WWV"
279 | COMPOSE
280 | fi
281 | }
282 |
283 |
284 | NEWS(){
285 | NEWS=$(yad --form --width=420 --text-align=center --center --title="News Reports" --text-align=center \
286 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
287 | --text="News Reports by KM4ACK\r\rNews reports provided by Reuters" \
288 | --field="Choose News Report":CB "Daily|Market|Money|US News" \
289 | --button="Main Menu":1 \
290 | --button="Continue":2)
291 | QUIT=$?
292 | NEWS=$(echo $NEWS | awk -F "|" '{print $1}')
293 |
294 | if [ $QUIT = 1 ]; then
295 | $MAIN &
296 | exit
297 | elif [ $QUIT = 252 ]; then
298 | exit
299 | fi
300 |
301 | if [ "$NEWS" = "Daily" ]; then
302 | TO="SMTP:query@saildocs.com"
303 | SUBJECT="subject"
304 | BODY="send Reuters-Daily-News"
305 | COMPOSE
306 | elif [ "$NEWS" = "Market" ]; then
307 | TO="SMTP:query@saildocs.com"
308 | SUBJECT="subject"
309 | BODY="send Reuters-Market"
310 | COMPOSE
311 | elif [ "$NEWS" = "Money" ]; then
312 | TO="SMTP:query@saildocs.com"
313 | SUBJECT="subject"
314 | BODY="send Reuters-Money"
315 | COMPOSE
316 | elif [ "$NEWS" = "US News" ]; then
317 | TO="SMTP:query@saildocs.com"
318 | SUBJECT="subject"
319 | BODY="send Reuters-US-News"
320 | COMPOSE
321 | fi
322 | }
323 |
324 | RADAR(){
325 | RADAR=$(yad --form --width=420 --text-align=center --center --title="Radar Reports" --text-align=center \
326 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
327 | --text="Radar Requests" \
328 | --field="Choose Radar":CB "Southern Miss Valley|Pacific Northwest|North Rockies|Upper Miss Valley|Central Great Lakes|Northeast|\
329 | Pacific Southwest|Southern Rockies|Southern Plains|Southeast|National|Alaska|Hawaii|Guam|Puerto Rico" \
330 | --button="Main Menu":1 \
331 | --button="Continue":2)
332 | QUIT=$?
333 | RADAR=$(echo $RADAR | awk -F "|" '{print $1}')
334 | TO=INQUIRY
335 | SUBJECT=REQUEST
336 |
337 | if [ $QUIT = 1 ]; then
338 | $MAIN &
339 | exit
340 | elif [ $QUIT = 252 ]; then
341 | exit
342 | fi
343 | case $RADAR in
344 | "Southern Miss Valley")
345 | BODY=US.RAD.SMVAL;;
346 | "Pacific Northwest")
347 | BODY=US.RAD.PNW;;
348 | "North Rockies")
349 | BODY=US.RAD.NROC;;
350 | "Upper Miss Valley")
351 | BODY=US.RAD.UMVAL;;
352 | "Central Great Lakes")
353 | BODY=US.RAD.GRLAK;;
354 | "Northeast")
355 | BODY=US.RAD.NEAST;;
356 | "Pacific Southwest")
357 | BODY=US.RAD.PACSW;;
358 | "Southern Rockies")
359 | BODY=US.RAD.SROC;;
360 | "Southern Plains")
361 | BODY=US.RAD.SPLA;;
362 | "Southeast")
363 | BODY=US.RAD.SEAST;;
364 | "National")
365 | BODY=US.RAD.CONUS;;
366 | "Alaska")
367 | BODY=US.RAD.ALASK;;
368 | "Hawaii")
369 | BODY=US.RAD.HAWAI;;
370 | "Guam")
371 | BODY=US.RAD.GUAM;;
372 | "Puerto Rico")
373 | BODY=US.RAD.PR;;
374 | esac
375 |
376 | COMPOSE
377 | }
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
--------------------------------------------------------------------------------
/catalog:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #Pat Catalog
4 | #20200427 KM4ACK
5 | #side note: written during covid-19 outbreak of 2020
6 |
7 |
8 | export MYPATH=$HOME/patmenu2
9 | LOGO=$MYPATH/pmlogo.png
10 | MAIN=$MYPATH/./patmenu
11 |
12 |
13 | yad --form --width=420 --text-align=center --center --title="Pat Catalog" --text-align=center \
14 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
15 | --text="Pat Catalog by KM4ACK" \
16 | --field="Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; GATEWAY"' \
17 | --field="Weather Reports":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; WEATHER"' \
18 | --field="Radar Request":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; RADAR"' \
19 | --field="Position Reports":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; POSITION"' \
20 | --field="Propagation Reports":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; PROPAGATION"' \
21 | --field="News Reports":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/cat-functions; NEWS"' \
22 | --field="Send SMS":fbtn 'bash -c "kill -USR1 $YAD_PID; $HOME/patmenu2/sms/manage-sms"' \
23 | --field="Convert WL2K_NEARBY to APRS":fbtn 'bash -c "kill -USR1 $YAD_PID; $HOME/patmenu2/convert_to_aprs"' \
24 | --button="Main Menu":1
25 |
26 | QUIT=$?
27 |
28 | if [ $QUIT = 1 ]; then
29 | $MAIN &
30 | exit
31 | elif [ $QUIT = 252 ]; then
32 | exit
33 | fi
--------------------------------------------------------------------------------
/changelog:
--------------------------------------------------------------------------------
1 | release=2.12.1
2 |
3 | Changelog
4 | 2.12.1 Fix two radar requests options that weren't working
5 | 2.12.0 cleanup format cat-functions script
6 | add radar requests (cat-functions)
7 | 2.11.0 add support for mobilinkd TNC 4
8 | add auto start modem
9 | fix false failure when starting vara modems
10 | 2.10.0 add VARA to getardoplist script
11 | add VARA to getardoplist-cron script
12 | add Pat Autoconnect VARA script
13 | add VARA modem to auto connect
14 | add VARA gateway search
15 | add modem check to start vara hf script
16 | add modem check to start vara fm script
17 | add current user to login/logout screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
18 | fix login cancel not returning to previous screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
19 | add current grid to manual grid update screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
20 | fix false ruby warning with GPS grid update - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
21 | update ruby install to 2.5
22 | add current grid to main screen - https://github.com/km4ack/patmenu2/issues/61
23 | 2.9.0 add 100 Mobiles to Position Request screen in catalog - https://github.com/km4ack/patmenu2/issues/51
24 | fix stop modems - https://github.com/km4ack/patmenu2/issues/51
25 | add wait for internet to getardoplist-cron - https://github.com/km4ack/patmenu2/issues/50
26 | add convert WL2K_NEARBY to APRS in Pat Catalog - Thanks to Kenny, KC4OJS for the idea!
27 | add convert_to_aprs file
28 | fix issue #54 when starting VARA modems - https://github.com/km4ack/patmenu2/issues/54
29 | add sms text feature
30 | add sound card to quick stats
31 | fix typo - https://github.com/km4ack/patmenu2/issues/57
32 | 2.8.0 redesign layout of main screen
33 | add new modem menu
34 | add vara modem start (beta)
35 | add vara FM modem start (beta)
36 | deprecate alternate grid list download function
37 | deprecate load alternate grid funtion
38 | add gateway distance/bearing recalculation
39 | add "save as" to current config file see https://github.com/km4ack/patmenu2/issues/48
40 | add config file name to bottom of main menu
41 | update menu shortcut to support non-pi usernames
42 | 2.7.0 add mobi-pair script to assist with pairing mobilinkd devices
43 | add mobilinkd wired modem connection (Doesn't work with version 2)
44 | improve mobilinkd modem start
45 | clean up initial config file
46 | add new custom warning feature
47 | fix path for repairing config file
48 | 2.6.1 improve GPS weather accuracy
49 | update ARDOP modem start
50 | update Packet modem start
51 | update Set ARDOP PTT section
52 | update readme file
53 | use default browser to open inbox instead of hard coding Chromium
54 | 2.6.0 add version check
55 | add peer to peer alias
56 | 2.6.0 does not support version of Pat prior to v0.12.0
57 |
58 | 2.5.0 update paths to accommodate Pat v0.12
59 | #Pat Menu 2.6 will not support older versions of Pat once it is released as stable code.
60 | #For now, 2.5 will remain on a seperate branch on GitHub. The master branch will continue
61 | #to support Pat v0.11 and earlier for the time being.
62 | fix pat port variable in quick stats
63 | add config repair
64 | add disable for auto list download
65 | add version check to .getardoplist-cron
66 | 2.4.0 Add pat server status to quick stats https://github.com/km4ack/patmenu2/issues/25
67 | Add alternate grid download
68 | Add alternate grid selection
69 | Add backup home grid ardop list files
70 | Add manage forms
71 | Add auto forms download - https://github.com/km4ack/patmenu2/issues/30
72 | fix issue 26 https://github.com/km4ack/patmenu2/issues/26
73 | fix issue 24 https://github.com/km4ack/patmenu2/issues/24
74 | 2.3.0 Add new mailbox management section
75 | archive all email
76 | delete archives
77 | delete sent
78 | Add listen modes to manage pat winlink section
79 | add mailbox management to main menu
80 | move email backup to inbox manage
81 | move email restore to inbox manage
82 | fix program exit after email restore
83 | add quick stats
84 | 2.2.2 Update Find Gateway Code for Packet in FA-functions
85 | Add manual grid update
86 | update logo to white background
87 | update /user/run/1000 to /user/run/$UID to make compatible with users other than pi
88 | fix issue #13
89 | add .gitignore
90 | 2.2.1 fix delete alias
91 | 2.2.0 add mobilinkd modem
92 | add multiple alias select in Find Ardop gateways
93 | update fa-funtions to show 100 stations in packet search
94 | add update sound card to settings/config
95 | add set ARDOP PTT to manage pat winlink
96 | 2.1.0 add set ARDOP speed to manage pat winlink
97 | add delete config feature
98 | update path in manage-menu
99 | update path in patmenu
100 | update path in catalog
101 | update path in manage-pat
102 | various script cleanup to remove notes
103 | 2.0.0 Hey!! Where is version 1? Here's the scoop,
104 | there is no version 1. We never made it to
105 | version 1 before I did a major overhaul of the
106 | code and added a GUI. I needed a way to
107 | differentiate it from the original and announce
108 | the major changes. Hence, Pat Menu 2 :-)
109 | 0.75 fix ardop from closing unexpectedly
110 | fix stop modems on exit
111 | add FLRIG check to auto pat
112 | 0.74 add option to install ruby if needed
113 | add gps grid update to manage pat winlink section
114 | bump version #
115 | 0.73 attempt to fix success notice for auto pat
116 | update path in main menu for new changelog file name
117 | rename release to changelog
118 | add alert if auto pat has no data to work with
119 | disallow starting modems multiple times
120 | check if FLRIG is running when starting modems
121 | bump version #
122 | 0.72 kill all modems on exit from main menu
123 | add notice to auto connect if no connections were successful
124 | bump version number
125 | 0.71 COMPLETE RE WRITE TO INCLUDE YAD INTERFACE
126 | bump version #
127 | 0.70 add version number to main menu
128 | create backup of start-pat2m
129 | fix issue 24 https://github.com/km4ack/patmenu/issues/24
130 | bum version #
131 | 0.69 fix issue 33 https://github.com/km4ack/patmenu/issues/33
132 | bump version #
133 | 0.68 remove bug warning from README.md
134 | reorder release file so latest revs at top
135 | fix release display in update script
136 | update config.default to match config
137 | fix typo in auto pat (Thanks Drudge!)
138 | bump version #
139 | 0.67 write email backup/restore scripts
140 | add email backup/restore to pat manage
141 | fix issue 25 https://github.com/km4ack/patmenu/issues/25
142 | move GRIB files to weather section https://github.com/km4ack/patmenu/issues/26
143 | add email-bkup & email-restore +x to setup file
144 | bump version #
145 | 0.66 stop modem starts from puking errors if var not found
146 | add extra check before trimode is run
147 | add pulseaudio/pavucontrol install check to trimode
148 | bump version #
149 | 0.65 add grib request to catalog
150 | bump version #
151 | 0.64 add amrron/trimode check to both modem start scripts
152 | bump version #
153 | 0.63 fix catalog typo that caused crash
154 | bump version #
155 | 0.62 add post position to catalog
156 | prevent stopping modems in autopat for amrron ops
157 | add trimode script for amrron operators
158 | revise trimode in config
159 | bump version #
160 | 0.61 update FLRIG rigctl in config (existing users will not see this)
161 | add trimode variable to config (existing users will not see this)
162 | bump version #
163 | 0.60 revert start-pat2m due to critical flaw
164 | bump version number
165 | 0.59 improve how direwolf starts on buster
166 | add slight delay after starting ardop mode
167 | bump version #
168 | 0.58 add callsign to config file (existing users will not see this)
169 | add config check when menu starts. exit if config not modded
170 | rig control set to no by default in config file
171 | bump version #
172 | 0.57 fix bug in add packet script
173 | bump version #
174 | 0.56 add min < max check in auto pat
175 | add answer check at beginning of auto pat
176 | rewrite patauto function in patmenu-new
177 | check running modems & stop if needed when running autopat
178 | add grid square check to getardoplist and warn if not set
179 | fix symlink in setup script
180 | add exit to restore config script
181 | convert callsign to upper case in catalog script
182 | bump version #
183 | 0.55 add exit option to changeconf script
184 | add symlink to setup for patmenu in /usr/local/bin
185 | open pat inbox in browser when starting packet or ardop modems
186 | change map viewer in findardop to variable
187 | fix map viewer error from showing in pat menu
188 | update main menu with new manage pat menu feature
189 | check autopat to make sure 20,30,40,80 is entered
190 | provide exit from autopat
191 | bump version #
192 | 0.54 update gpsdata var in catalog. Thanks K4KDR!
193 | create changeconf script to deal with multiple config files
194 | add menu-mange script for pat menu management
195 | update setup script to +x changeconf & menu-manage
196 | bump version #
197 | 0.53 add buster check to start-pat2m
198 | bump version #
199 | 0.52 Fix missing file in alias-add-packet
200 | revert to old style symlink until issue is resolved with new style
201 | move kissattach to variable in config file
202 | update restore-config file
203 | bump version #
204 | 0.51 Fix variable in autopat
205 | add packet list download to getardoplist
206 | add script alias-add-packet
207 | add script restore-config
208 | update pat-manage menu
209 | update setup script
210 | bump version #
211 | 0.50 add way to exit alias-del
212 | make desktop shortcut executable
213 | add rigcontrol check to alias-add for right shortcut
214 | complete re write of findardop that includes add alias shortcuts
215 | bump version #
216 | 0.49 fix bug and add alias-del
217 | update pat-manage
218 | add band/freq to new alias when added from pat manage
219 | bump version #
220 | 0.48 remove alias-del until major bug can be resolved
221 | bump version #
222 | 0.47 add alias-add script
223 | add alias-del script
224 | add check/install jq to setup script (needed for new alias scripts)
225 | add new pat manage menu script
226 | update main menu to include pat manage script
227 | bump version #
228 | 0.46 add last DL to findardop
229 | add log file entry to getardoplist
230 | update readme file
231 | bump version #
232 | 0.45 sort getardoplist by distance
233 | new style desktop link to setup script
234 | bump version #
235 | 0.44 add set-auto-update to findardop script
236 | add new script auto-download called from findardop
237 | add YAD install to setup script
238 | 0.43 start modems in backgound
239 | verify other modem not running before starting a new modem
240 | stop ardop_gui when stopping modems
241 | fix issue #17-choose correct text editor based on version
242 | 0.42 give user info on change log before update
243 | add rig control check to auto-pat
244 | 0.41 add start ARDOP-GUI to start ardop
245 | add start ARDOP-GUI to autopat
246 | remove temp files at start of autopat
247 | 0.40 change rigctld start in autopat
248 | add backup for config
249 | 0.39 add rigctld check & start to autopat
250 | 0.38 close if/then statement in start-pat2m
251 | 0.37 add rigctld check & start if needed to start-pat2m
252 | 0.36 add rigctld check & start if needed to start-pat-ardop
253 | 0.35 move log file variable to config file
254 | 0.34 update uninstall
255 | 0.33 add mode to config file
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
--------------------------------------------------------------------------------
/config:
--------------------------------------------------------------------------------
1 | #20191230 KM4ACK
2 | #last edit 04MARCH2022 KM4ACK
3 |
4 | #change next line to your call sign
5 | MYCALLSIGN=N0CALL
6 |
7 | #command to start ARDOP modem
8 | ARDOP="$HOME/ardop/./piardopc 8515 plughw:1,0 plughw:1,0"
9 |
10 | #Path to ardop-gui if installed
11 | ARDOPGUI=$HOME/ardop/./piARDOP_GUI
12 |
13 | #command to start direwolf
14 | DIREWOLF="direwolf -p"
15 |
16 | #Kiss attach command
17 | KISS="sudo /usr/sbin/kissattach /tmp/kisstnc"
18 |
19 | #axport name for kissattach
20 | AXP=wl2k
21 |
22 | #Set map to use with findardop
23 | MAP=usa
24 | #MAP=world
25 |
26 | #Use rig control? yes or no
27 | #NOTE: autopat will not work without rig control
28 | RIGCONTROL=no
29 |
30 | #enter your rig control command below. DO NOT enter mode
31 | #or frequency commands as these are handled by the script
32 | #Be sure to not delete the quotation marks. DO NOT use
33 | #"rigctld" here. Use "rigctl"
34 | #example for Yaesu 857D
35 | #RIG="/usr/local/bin/rigctl -m 122 -r /dev/ttyUSB0 -s 4800"
36 |
37 | #Pass rig control commands through FLRIG (default)
38 | RIG="/usr/local/bin/rigctl -m 4"
39 |
40 | #Mode used for HF digital comms on your radio
41 | MODEHF=USB
42 |
43 | #Mode used for packet digital comms on your radio
44 | MODE2M=FM
45 |
46 | #port number for pat inbox ie. 127.0.0.1:8080
47 | PORT=8080
48 |
49 | #Path to log file
50 | LOG=$HOME/Documents/mylog.txt
51 |
52 | #Below this line is only useful to AMRRON operators. Others shouldn't edit below this line.
53 | #NOTE:The AMRRON portion of this script is still experimental.
54 |
55 | #set next line to yes for tri-mode setup
56 | AMRRON=no
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/convert_to_aprs:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #scirpt to convert WL2K_NEARBY to POS file
4 | #that can be imported into YAAC
5 | #KM4ACK 01AUGUST2022
6 |
7 | MYPATH=$HOME/patmenu2
8 | LOGO=$MYPATH/pmlogo.png
9 | MAIN=$MYPATH/./catalog
10 | CONFIG=$HOME/.config/pat/config.json
11 | PATCALL=$(grep mycall $HOME/.config/pat/config.json | head -1 | sed 's/"mycall": "//;s/",//;s/ //g')
12 | LIST=$HOME/.local/share/pat/mailbox/$PATCALL/in
13 | MAILBOX=$HOME/.local/share/pat/mailbox/$PATCALL/in
14 |
15 |
16 |
17 | #remove exiting file if it exist
18 | if [ -f $HOME/Desktop/gateways.pos ]; then
19 | rm $HOME/Desktop/gateways.pos
20 | fi
21 |
22 | #give user feedback
23 | yad --center --timeout=2 --timeout-indicator=top --no-buttons \
24 | --text="Processing File" &
25 |
26 | #Look for the WL2K_NEARBY email
27 | COUNT=0
28 | #var=$((var+1))
29 | for file in $MAILBOX/*
30 | do
31 | NEARBY_LIST=$(grep WL2K_NEARBY $file)
32 | if [ -n "$NEARBY_LIST" ]; then
33 | COUNT=$((COUNT+1))
34 | if [ $COUNT -gt 1 ]; then
35 | #Warn user about multiple WL2K_NEARBY Reports in inbox
36 | yad --form --width=500 --text-align=center --center --title="WL2K to ARPS Object" --text-align=center \
37 | --image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
38 | --text="Multiples Found\rBe sure only one WL2K_NEARBY report\ris in your inbox. Multiples will cause erroneous data." \
39 | --button=gtk-ok
40 | $MAIN &
41 | exit
42 | fi
43 | FILE=$file
44 | fi
45 | done
46 |
47 | #create a copy to work with
48 | cp $FILE /run/user/$UID/tempgatelist
49 |
50 | #check that we have a file. warn user if not
51 | if [ $? = 1 ]; then
52 | yad --form --width=500 --text-align=center --center --title="WL2K to ARPS Object" --text-align=center \
53 | --image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
54 | --text="FAILED\rNo Nearby (WL2K_NEARBY) File Found in Inbox"
55 | $MAIN &
56 | exit
57 | fi
58 |
59 | #remove everything but the data we need at the top of the file
60 | sed -i '1,17d' /run/user/$UID/tempgatelist
61 |
62 | ###########NOTE#############
63 | #APRS symbol lookup table can be found at
64 | #https://4.bp.blogspot.com/-ewK-9I_62wk/WIMI_LFpEII/AAAAAAAAWYA/xMso0AANY649LEWvOAjMIsmyPLWBwOszQCLcB/s1600/KWFAPRS_LUTv2.png
65 | #In the echo command below I have used "\a" which produces a red diamond on the map. The "\" goes between the $LAT $LONG and the
66 | #second character goes between the $LONG and $Comment
67 | #########End Note###########
68 |
69 | #process the file
70 | while read -r line; do
71 | CALL=$(echo $line | awk '{print $1}')
72 | CALL=`printf "%-9s" $CALL`
73 | LAT=$(echo $line | awk '{print $5}' | sed 's/-//')
74 | LONG=$(echo $line | awk '{print $6}' | sed 's/-//')
75 | COMMENT=$(echo $line | awk '{$1=$2=$3=$4=$5=$6=$7=$8=""; print $0}' | sed -e 's/^[ \t]*//')
76 | TIME=$(date -u +%H%M%S)
77 |
78 | # echo ";$CALL*$TIME""h""$LAT/$LONG-$COMMENT" >> ~/Desktop/gateways.pos (Produces a house on the map)
79 | echo ";$CALL*$TIME""h""$LAT\\$LONG""a""$COMMENT" >> ~/Desktop/gateways.pos #(Produces a red diamond on the map)
80 | done < /run/user/$UID/tempgatelist
81 |
82 | #let user know processing is finished
83 | yad --form --width=500 --text-align=center --center --title="WL2K to ARPS Object" --text-align=center \
84 | --image ${LOGO} --window-icon=${LOGO} --image-on-top --separator="|" --item-separator="|" \
85 | --text="Processing done.\rA gateways.pos file has been created and\r is on your desktop ready to import into YAAC." \
86 | --button=gtk-ok
87 |
88 | #remove the temp file
89 | rm /run/user/$UID/tempgatelist
90 | $MAIN &
91 | exit
--------------------------------------------------------------------------------
/default.config:
--------------------------------------------------------------------------------
1 | #20191230 KM4ACK
2 |
3 | #This setup is designed to work with a VOX soundcard (ie Signalink)
4 | #If using a VOX soundcard or radio with a VOX soundcard built in
5 | #simply edit the call sign below to yours and change
6 | #RIGCONTROL=no to RIGCONTROL=yes below.
7 | #Now test the setup. Be sure you have FLRIG open
8 | #and configured for your radio.
9 | #AMRRON operators see bottom of this file for trimode.
10 |
11 |
12 | #change next line to your call sign
13 | MYCALLSIGN=N0CALL
14 |
15 | #enter your piardopc command on the line below
16 | #Be sure to not delete the quotation marks.
17 | ARDOP="$HOME/ardop/./piardopc 8515 plughw:1,0 plughw:1,0"
18 |
19 | #Path to ardop-gui if installed
20 | ARDOPGUI=$HOME/ardop/./piARDOP_GUI
21 |
22 | #command to start direwolf
23 | DIREWOLF="direwolf -p"
24 |
25 | #Kiss attach command
26 | KISS="sudo /usr/sbin/kissattach /tmp/kisstnc"
27 |
28 | #axport name for kissattach
29 | AXP=wl2k
30 |
31 | #Set map to use with findardop
32 | MAP=usa
33 | #MAP=world
34 |
35 | #Use rig control? yes or no
36 | #NOTE: autopat will not work without rig control
37 | RIGCONTROL=no
38 |
39 | #enter your rig control command below. DO NOT enter mode
40 | #or frequency commands as these are handled by the script
41 | #Be sure to not delete the quotation marks. DO NOT use
42 | #"rigctld" here. Use "rigctl"
43 | #example for Yaesu 857D
44 | #RIG="/usr/local/bin/rigctl -m 122 -r /dev/ttyUSB0 -s 4800"
45 |
46 | #Pass rig control commands through FLRIG (default)
47 | RIG="/usr/local/bin/rigctl -m 4"
48 |
49 | #Mode used for HF digital comms on your radio
50 | MODEHF=USB
51 |
52 | #Mode used for packet digital comms on your radio
53 | MODE2M=FM
54 |
55 | #port number used by pat html service
56 | #pat default is 8080. I prefer 5000
57 | PORT=8080
58 |
59 | #Path to log file
60 | LOG=$HOME/Documents/mylog.txt
61 |
62 | #Below this line is only useful to AMRRON operators. Others shouldn't edit below this line.
63 | #NOTE:The amrron portion of this script is still experimental.
64 |
65 | #set next line to yes for tri-mode setup
66 | AMRRON=no
67 |
68 | #amrron operaters should save/exit this config file after setting above to yes and then run
69 | # bash ~/patmenu/trimode
70 | #to enable trimode ops
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/find2:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #FIND-ARDOP
4 | #20200425 KM4ACK
5 | #side note: written during covid-19 outbreak of 2020
6 |
7 | MYPATH=$HOME/patmenu2
8 | PATMENU=$MYPATH/patmenu
9 | LOGO=$MYPATH/pmlogo.png
10 | CURRENT=$(crontab -l | grep getardoplist | awk '{print $2":"$1}')
11 | source $MYPATH/.grid
12 | GRID=$(grep GRID $HOME/patmenu2/ardop-list/grid.txt | sed 's/GRID=//')
13 | LASTDOWNLOAD=$(grep LASTDL $HOME/patmenu2/ardop-list/grid.txt | tail -1 | sed 's/LASTDL=//')
14 |
15 | source $MYPATH/FA-functions
16 |
17 | yad --form --width=480 --text="Find Gateways by KM4ACK" --text-align=center --center --title="Find Gateways" --text-align=center \
18 | --image $LOGO --window-icon=$LOGO --image-on-top \
19 | --text="Find Gateways by KM4ACK" \
20 | --field="Search for Gateway":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; GRIDSEARCH"' \
21 | --field="View Grid Map":fbtn 'bash -c "source $MYPATH/FA-functions; MAP"' \
22 | --field="Download Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; DOWNLIST"' \
23 | --field="Auto Download Gateway List $CURRENT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; AUTODOWN"' \
24 | --field="Recalculate Distance and Bearings":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; NEWCALC"' \
25 | --field="$LASTDOWNLOAD":LBL \
26 | --field="Current calculations based on grid $GRID":LBL \
27 | --button="Main Menu":1
28 |
29 | QUIT=$?
30 |
31 | if [ $QUIT = 1 ]; then
32 | $PATMENU &
33 | exit
34 | elif [ $QUIT = 252 ]; then
35 | exit
36 | fi
37 |
38 |
39 | #left for reference
40 | #--field="Download Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; ALTGRID"' \
41 | #--field="Load Alternate Grid Gateway List":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/FA-functions; LOADALTGRID"' \
42 |
--------------------------------------------------------------------------------
/getardoplist:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #This script will download the ardop list to the path set below
4 | #It is intended to be run by cron daily
5 | #to keep the list current. km4ack 20181214
6 | #Hint: create a cron job that reads
7 | #30 23 * * * /usr/local/bin/getardoplist
8 | #This script is provided AS IS
9 | #Feel free to mod for your use
10 |
11 | #Two versions of this script exist. One for manual downloads and
12 | #one for cron downloads. The one for cron has no YAD interface.
13 | #Cron wouldn't run correctly with YAD in the code. The other file
14 | #is .getardoplist-cron
15 |
16 | TODAY=$(date)
17 |
18 | #path where files are located
19 | #must match path in findardop script
20 | MYPATH=$HOME/patmenu2/ardop-list/
21 | MYVARA=$HOME/patmenu2/vara-list/
22 |
23 | #my log file
24 | LOG=$HOME/Documents/mylog.txt
25 |
26 | GRIDCK=$(jq .locator $XDG_CONFIG_HOME/pat/config.json)
27 | if [ ${#GRIDCK} -lt 3 ]
28 | then
29 | echo "Grid square not set in Pat Configure" | tee -a $LOG
30 | echo "Distances/Bearings will not be accurate"
31 | yad --center \
32 | --text="Grid square not set in Pat Configure File.\r Run \'pat configure\' to fix"
33 | #exit
34 | fi
35 |
36 | #make directory if it doesn't exist
37 | mkdir -p $MYPATH $MYVARA
38 |
39 | #set variables for each ardop list
40 | FILE=$MYPATH'ardoplist.txt'
41 | EIGHTY=$MYPATH'80mardoplist.txt'
42 | FORTY=$MYPATH'40mardoplist.txt'
43 | TWENTY=$MYPATH'20mardoplist.txt'
44 | THIRTY=$MYPATH'30mardoplist.txt'
45 | PACKET=$MYPATH'packet.txt'
46 |
47 | #set variables for each vara list
48 | VARAFILE=$MYVARA'varalist.txt'
49 | VARAEIGHTY=$MYVARA'80mvaralist.txt'
50 | VARAFORTY=$MYVARA'40mvaralist.txt'
51 | VARATWENTY=$MYVARA'20mvaralist.txt'
52 | VARATHIRTY=$MYVARA'30mvaralist.txt'
53 | VARAFM=$MYVARA'varafm.txt'
54 |
55 | GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator"://;s/"//g;s/,//;s/ //g')
56 | echo "GRID=$GRID" > $HOME/patmenu2/.grid
57 |
58 | #check internet connection
59 | echo "Please wait while we check your internet connection"
60 | echo "This may take up to a minute"
61 | #yad --center --timeout=3 --timeout-indicator=top --no-buttons \
62 | #--text="Please wait while we check your connection \rThis can take up to 30 seconds" &
63 | wget -q --tries=5 --timeout=10 --spider http://google.com #| yad --center --progress --pulsate --timeout-indicator=top --auto-close --no-buttons --text="Checking internet connection"
64 | if [[ $? -eq 0 ]]; then
65 | echo
66 | #yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Connection Detected" &
67 | echo
68 | echo "Please wait while files are download"
69 | echo "This may take several minutes"
70 | echo "Depending on your internet speed"
71 | else
72 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="You are not connected to the internet"
73 | exit
74 | fi
75 | #remove old vara files before downloading new ones
76 | if [ -f $VARATHIRTY ]; then
77 | rm $VARATHIRTY
78 | fi
79 |
80 | if [ -f $VARAFILE ]; then
81 | rm $VARAFILE
82 | fi
83 |
84 | if [ -f $VARAEIGHTY ]; then
85 | rm $VARAEIGHTY
86 | fi
87 |
88 | if [ -f $VARAFORTY ]; then
89 | rm $VARAFORTY
90 | fi
91 |
92 | if [ -f $VARATWENTY ]; then
93 | rm $VARATWENTY
94 | fi
95 |
96 | if [ -f $VARAFM ]; then
97 | rm $VARAFM
98 | fi
99 |
100 | #remove old ardop list before downloading new ones
101 |
102 | if [ -f $THIRTY ]; then
103 | rm $THIRTY
104 | fi
105 |
106 | if [ -f $FILE ]; then
107 | rm $FILE
108 | fi
109 |
110 | if [ -f $EIGHTY ]; then
111 | rm $EIGHTY
112 | fi
113 |
114 | if [ -f $FORTY ]; then
115 | rm $FORTY
116 | fi
117 |
118 | if [ -f $TWENTY ]; then
119 | rm $TWENTY
120 | fi
121 |
122 | if [ -f $PACKET ]; then
123 | rm $PACKET
124 | fi
125 |
126 |
127 | #create file that has grid variable used in calculations
128 | touch $HOME/patmenu2/ardop-list/grid.txt
129 | MYGRID=$(grep locator $HOME/.config/pat/config.json | sed 's/.*": //;s/"//g;s/,//')
130 | echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt
131 | echo "LASTDL=List downloaded `date`" >> $HOME/patmenu2/ardop-list/grid.txt
132 |
133 |
134 | #download list to individual files.
135 | DL(){
136 | pat rmslist -s --mode ardop --force-download >> $FILE
137 | pat rmslist -s --band 80m --mode ardop --force-download >> $EIGHTY
138 | pat rmslist -s --band 40m --mode ardop --force-download >> $FORTY
139 | pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY
140 | pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY
141 | pat rmslist -s --mode packet --force-download >> $PACKET
142 |
143 | pat rmslist -s --mode vara --force-download >> $VARAFILE
144 | pat rmslist -s --band 80m --mode vara --force-download >> $VARAEIGHTY
145 | pat rmslist -s --band 40m --mode vara --force-download >> $VARAFORTY
146 | pat rmslist -s --band 20m --mode vara --force-download >> $VARATWENTY
147 | pat rmslist -s --band 30m --mode vara --force-download >> $VARATHIRTY
148 | pat rmslist -s --band 2m --mode varafm --force-download >> $VARAFM
149 |
150 | yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Downloads Done" &
151 | }
152 | DL | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center \
153 | --text="Downloading....This takes ~30 seconds\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the download."
154 |
155 | #as of August 2022 the downloaded VARA lists do not include the URL needed for pat.
156 | #This section will generate the needed URL and update the downloaded files.
157 |
158 | #####GENERATE URL FOR 20M VARA File###########
159 | VARATEMP=/run/user/$UID/varatemp
160 | if [ -f $VARATEMP ]; then
161 | rm $VARATEMP
162 | fi
163 | sed -i '/^$/d' $VARATWENTY
164 | sed -i '1,3d' $VARATWENTY
165 |
166 | while read -r line; do
167 | CALL=$(echo $line | awk '{print$1}')
168 | FREQ=$(echo $line | sed 's/.*14./14./' | awk '{print$1}' | sed 's/\.//')
169 | URL="vara:///$CALL?freq=$FREQ"
170 | echo $line | sed "s||${URL}|" >> $VARATEMP
171 | done <$VARATWENTY
172 |
173 | mv $VARATEMP $VARATWENTY
174 |
175 | ##############################################
176 |
177 | #####GENERATE URL FOR 30M VARA File###########
178 | VARATEMP=/run/user/$UID/varatemp
179 | if [ -f $VARATEMP ]; then
180 | rm $VARATEMP
181 | fi
182 | sed -i '/^$/d' $VARATHIRTY
183 | sed -i '1,3d' $VARATHIRTY
184 |
185 | while read -r line; do
186 | CALL=$(echo $line | awk '{print$1}')
187 | FREQ=$(echo $line | sed 's/.*10./10./' | awk '{print$1}' | sed 's/\.//')
188 | URL="vara:///$CALL?freq=$FREQ"
189 | echo $line | sed "s||${URL}|" >> $VARATEMP
190 | done <$VARATHIRTY
191 |
192 | mv $VARATEMP $VARATHIRTY
193 |
194 | ##############################################
195 |
196 | #####GENERATE URL FOR 40M VARA File###########
197 | VARATEMP=/run/user/$UID/varatemp
198 | if [ -f $VARATEMP ]; then
199 | rm $VARATEMP
200 | fi
201 | sed -i '/^$/d' $VARAFORTY
202 | sed -i '1,3d' $VARAFORTY
203 |
204 | while read -r line; do
205 | CALL=$(echo $line | awk '{print$1}')
206 | FREQ=$(echo $line | sed 's/.*7./7./' | awk '{print$1}' | sed 's/\.//')
207 | URL="vara:///$CALL?freq=$FREQ"
208 | echo $line | sed "s||${URL}|" >> $VARATEMP
209 | done <$VARAFORTY
210 |
211 | mv $VARATEMP $VARAFORTY
212 |
213 | ##############################################
214 |
215 | #####GENERATE URL FOR 80M VARA File###########
216 | VARATEMP=/run/user/$UID/varatemp
217 | if [ -f $VARATEMP ]; then
218 | rm $VARATEMP
219 | fi
220 | sed -i '/^$/d' $VARAEIGHTY
221 | sed -i '1,3d' $VARAEIGHTY
222 |
223 | while read -r line; do
224 | CALL=$(echo $line | awk '{print$1}')
225 | FREQ=$(echo $line | sed 's/.*3./3./' | awk '{print$1}' | sed 's/\.//')
226 | URL="vara:///$CALL?freq=$FREQ"
227 | echo $line | sed "s||${URL}|" >> $VARATEMP
228 | done <$VARAEIGHTY
229 |
230 | mv $VARATEMP $VARAEIGHTY
231 |
232 | ##############################################
233 |
234 |
235 | if [ -f "$FILE" ]
236 | then
237 | echo $TODAY" RMS Gateway list download Success" >> $LOG
238 | echo;echo "RMS gateway list download success"
239 | else
240 | echo $TODAY" RMS Gateway list download FAIL" >> $LOG
241 | echo;echo "RMS gateway list failed to download"
242 | fi
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
--------------------------------------------------------------------------------
/getgrid:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require 'gpsd_client'
4 | require 'maidenhead'
5 | require 'socket'
6 | require 'json'
7 |
8 | ft8call_port = 2237
9 |
10 | gpsd = GpsdClient::Gpsd.new()
11 | gpsd.start()
12 | apicmd = {}
13 |
14 | #print come info to the scree
15 | #puts "Your location is being update"
16 |
17 | # get maidenhead if gps is ready
18 | if gpsd.started?
19 | pos = gpsd.get_position
20 | maid = Maidenhead.to_maidenhead(pos[:lat], pos[:lon], precision = 5)
21 | # puts "lat = #{pos[:lat]}, lon = #{pos[:lon]}, grid = #{maid}"
22 | puts "#{maid}"
23 | apicmd = {:type => "STATION.SET_GRID", :value => maid}
24 | end
25 |
26 |
--------------------------------------------------------------------------------
/griblist:
--------------------------------------------------------------------------------
1 | false
2 | WIND
3 | false
4 | PRESS
5 | false
6 | WAVES
7 | false
8 | APCP
9 | false
10 | PRMSL
11 | false
12 | HGT500
13 | false
14 | SFCTMP
15 | false
16 | TMP500
17 | false
18 | LFTX
19 | false
20 | CAPE
21 |
22 |
23 |
--------------------------------------------------------------------------------
/grid-map.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/km4ack/patmenu2/e5ef6416c6a9619c1be06cbe0fc78aadbb55bcbf/grid-map.pdf
--------------------------------------------------------------------------------
/manage-form-functions:
--------------------------------------------------------------------------------
1 | MYPATH=$HOME/patmenu2
2 | MAIN=$MYPATH/./manage-forms
3 | LOGO=$MYPATH/pmlogo.png
4 |
5 | DOWNLOAD(){
6 | #yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Downloading Forms - Please wait" \
7 | #--image $LOGO --window-icon=$LOGO --image-on-top &
8 | lxterminal -e /usr/bin/pat updateforms
9 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Forms Download Complete" \
10 | --image $LOGO --window-icon=$LOGO --image-on-top
11 | exit &
12 | $MAIN
13 | }
14 |
15 | AUTO-DOWNLOAD(){
16 | CHOICE="Weekly,At-Boot"
17 | FREQ=$(yad --center --wrap --width=350 --title="Auto Download" --text-align=center \
18 | --text="Download Weekly or at boot?" \
19 | --image $LOGO --window-icon=$LOGO --image-on-top \
20 | --button="Update:2" \
21 | --button="Cancel:1" \
22 | --form --separator="," --item-separator="," \
23 | --field="Choose":CB $CHOICE \
24 | )
25 | BUT=$?
26 | FREQ=$(echo $FREQ | awk -F "|" '{print $1}' | sed 's/,//')
27 | if [ $FREQ = 'At-Boot' ]; then
28 | FREQ=@reboot
29 | fi
30 | echo "FREQ = $FREQ"
31 | if [ $BUT = 1 ]; then
32 | exit &
33 | $MAIN
34 | elif [ $BUT = 252 ]; then
35 | exit
36 | elif [ $BUT = 2 ]; then
37 | echo "updating cron"
38 | FILE=/run/user/$UID/cron.txt
39 | crontab -l > $FILE
40 | sed -i '/updateforms$/d' $FILE
41 | if [ $FREQ = '@reboot' ]; then
42 | TEXT="@reboot sleep 10 && /usr/bin/pat updateforms"
43 | FREQ="At-Boot"
44 | else
45 | TEXT="0 4 * * 6 /usr/bin/pat updateforms"
46 | FREQ="Weekly"
47 | fi
48 | echo "$TEXT" >> $FILE
49 | crontab $FILE
50 | rm $FILE
51 | exit &
52 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Auto download set to $FREQ" \
53 | --image $LOGO --window-icon=$LOGO --image-on-top
54 | $MAIN
55 | fi
56 |
57 | }
--------------------------------------------------------------------------------
/manage-forms:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export MYPATH=$HOME/patmenu2
4 | LOGO=$MYPATH/pmlogo.png
5 | source $MYPATH/manage-pat-functions
6 | MAIN=$MYPATH/patmenu
7 | FILE=/run/user/$UID/tempcron.txt
8 | crontab -l > $FILE
9 | STATUS=$(grep updateforms $FILE | awk '{print $1}')
10 | rm $FILE
11 |
12 | if [ $STATUS = 0 ]; then
13 | STATUS=Weekly
14 | elif [ $STATUS = '@reboot' ]; then
15 | STATUS="At boot"
16 | else
17 | STATUS="Not Set"
18 | fi
19 |
20 | yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-align=center \
21 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
22 | --text="Manage Pat by KM4ACK" \
23 | --field="Download Latest Forms":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-form-functions; DOWNLOAD"' \
24 | --field="Auto Download Forms $STATUS":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-form-functions; AUTO-DOWNLOAD"' \
25 | --button="Main Menu":1
26 | BUT=$?
27 |
28 | if [ $BUT = 1 ]; then
29 | $MAIN &
30 | exit
31 | fi
--------------------------------------------------------------------------------
/manage-inbox:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export MYPATH=$HOME/patmenu2
4 | LOGO=$MYPATH/pmlogo.png
5 | MAIN=$MYPATH/./patmenu
6 | VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//')
7 |
8 | CALL=$(grep mycall ~/.wl2k/config.json | head -1 | sed 's/"//g;s/mycall: //;s/,//;s/ //g')
9 |
10 |
11 | yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
12 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
13 | --text="Pat Menu by KM4ACK\rv$VERSION" \
14 | --field="Archive All Email":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-inbox-functions; ARCHIVE-ALL"' \
15 | --field="Delete Archived Email":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-inbox-functions; DELETE-ARCHIVE"' \
16 | --field="Delete Sent Email":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-inbox-functions; DELETE-SENT"' \
17 | --field="Backup Email":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-inbox-functions; EMAILBKUP"' \
18 | --field="Restore Email":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-inbox-functions; EMAILRESTORE"' \
19 | --button="Main Menu":1
20 | BUT=$?
21 |
22 | if [ $BUT = 1 ]; then
23 | $MAIN &
24 | exit
25 | elif [ $BUT = 252 ]; then
26 | exit 0
27 | fi
--------------------------------------------------------------------------------
/manage-inbox-functions:
--------------------------------------------------------------------------------
1 | MYPATH=$HOME/patmenu2
2 | MAIN=$MYPATH/./manage-inbox
3 | LOGO=$MYPATH/pmlogo.png
4 | VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//')
5 |
6 | source $MYPATH/config
7 |
8 | IN=$HOME/.local/share/pat/mailbox/$MYCALLSIGN/in
9 | ARCHIVE=$HOME/.local/share/pat/mailbox/$MYCALLSIGN/archive
10 | SENT=$HOME/.local/share/pat/mailbox/$MYCALLSIGN/sent
11 |
12 | ARCHIVE-ALL(){
13 | mv $IN/* $ARCHIVE/
14 | yad --form --width=420 --height=100 --text-align=center --center --title="Pat Menu" --text-align=center \
15 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
16 | --text="Pat Menu by KM4ACK\rv$VERSION\rEmails Archived" \
17 | --button=gtk-ok
18 | $MAIN &
19 | }
20 |
21 | DELETE-ARCHIVE (){
22 | yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
23 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
24 | --text="Pat Menu by KM4ACK\rv$VERSION\rARE YOU SURE YOU WANT TO DELETE\rALL ITEMS FROM YOUR ARCHIVE FOLDER?\rTHIS CAN'T BE UNDONE" \
25 | --button="Yes I'm Sure":2 \
26 | --button="No":1
27 | BUT=$?
28 | if [ $BUT = 1 ]; then
29 | $MAIN &
30 | exit 0
31 | elif [ $BUT = 252 ]; then
32 | exit
33 | elif [ $BUT = 2 ]; then
34 | rm $ARCHIVE/*
35 | yad --form --width=420 --height=100 --text-align=center --center --title="Pat Menu" --text-align=center \
36 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
37 | --text="Pat Menu by KM4ACK\rv$VERSION\rArchives Deleted" \
38 | --button=gtk-ok
39 | $MAIN &
40 | fi
41 | }
42 |
43 | DELETE-SENT(){
44 | yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
45 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
46 | --text="Pat Menu by KM4ACK\rv$VERSION\rARE YOU SURE YOU WANT TO DELETE\rALL ITEMS FROM YOUR SENT FOLDER?\rTHIS CAN'T BE UNDONE" \
47 | --button="Yes I'm Sure":2 \
48 | --button="No":1
49 | BUT=$?
50 | if [ $BUT = 1 ]; then
51 | $MAIN &
52 | exit 0
53 | elif [ $BUT = 252 ]; then
54 | exit
55 | elif [ $BUT = 2 ]; then
56 | rm $SENT/*
57 | yad --form --width=420 --height=100 --text-align=center --center --title="Pat Menu" --text-align=center \
58 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
59 | --text="Pat Menu by KM4ACK\rv$VERSION\rSent Emails Deleted" \
60 | --button=gtk-ok
61 | $MAIN &
62 | fi
63 | }
64 |
65 | EMAILBKUP(){
66 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
67 | WHO=$(whoami)
68 | CALL=$(cat $XDG_CONFIG_HOME/pat/config.json | grep -m 1 mycall | sed 's/\"mycall\": \"//' | sed 's/\",//' | sed -e 's/^\s*//' | tr '[:lower:]' '[:upper:]')
69 | BKUPTIME=$(date +%Y%d%m-%H%M)
70 |
71 | BACKUP=$(yad --form --width=420 --text-align=center --center --title="Email Backup" --text-align=center \
72 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
73 | --text="Email Backup by KM4ACK" \
74 | --field="Backup Directory":DIR \
75 | --button="Backup Emails":2 \
76 | --button="Cancel":1)
77 | BUT=$?
78 |
79 | if [ $BUT = 252 ]; then
80 | exit
81 | elif [ $BUT = 1 ]; then
82 | $MAIN
83 | exit
84 | fi
85 |
86 | DIR=$(echo $BACKUP | awk -F "|" '{print $1}')
87 |
88 | cp -r $HOME/.local/share/pat/mailbox/$CALL $DIR/email.bkup.$BKUPTIME
89 |
90 | if [ -d $DIR/email.bkup.$BKUPTIME ]; then
91 | yad --center --text="Backup Complete" \
92 | --button=gtk-ok
93 | $MAIN &
94 | exit
95 | fi
96 | }
97 |
98 |
99 | EMAILRESTORE(){
100 | MYPATH=$HOME/dev/patmenu2
101 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
102 | WHO=$(whoami)
103 | CALL=$(cat $XDG_CONFIG_HOME/pat/config.json | grep -m 1 mycall | sed 's/\"mycall\": \"//' | sed 's/\",//' | sed -e 's/^\s*//' | tr '[:lower:]' '[:upper:]')
104 |
105 | RESTORE=$(yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
106 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
107 | --text="Email Restore by KM4ACK" \
108 | --field="Restore Directory":DIR \
109 | --button="Restore Emails":2 \
110 | --button="Cancel":1)
111 | BUT=$?
112 |
113 | if [ $BUT = 252 ]; then
114 | exit
115 | elif [ $BUT = 1 ]; then
116 | $MAIN &
117 | exit
118 | fi
119 |
120 | DIR=$(echo $RESTORE | awk -F "|" '{print $1}')
121 | DIRCHECK=$(ls $DIR)
122 | COUNT=${#DIRCHECK}
123 | if [ "$COUNT" = 19 ]; then
124 | cp $DIR/archive/* $HOME/.local/share/pat/mailbox/$CALL/archive/
125 | cp $DIR/in/* $HOME/.local/share/pat/mailbox/$CALL/in/
126 | cp $DIR/out/* $HOME/.local/share/pat/mailbox/$CALL/out/
127 | cp $DIR/sent/* $HOME/.local/share/pat/mailbox/$CALL/sent/
128 | yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
129 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
130 | --text="Email Restore by KM4ACK\r\rRESTORE COMPLETE" \
131 | --button=gtk-ok
132 | else
133 | yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
134 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
135 | --text="Email Restore by KM4ACK\r\rNot a valid restore directory" \
136 | --button=gtk-ok
137 | fi
138 | $MAIN &
139 | exit
140 |
141 | }
142 |
143 |
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/manage-menu:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export MYPATH=$HOME/patmenu2
4 | LOGO=$MYPATH/pmlogo.png
5 | source $MYPATH/manage-menu-functions
6 | MAIN=$MYPATH/patmenu
7 |
8 |
9 | yad --form --width=420 --text-align=center --center --title="Settings" --text-align=center \
10 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
11 | --text="Pat Menu Settings/Config by KM4ACK" \
12 | --field="Current Config Settings":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-menu-functions; CURRENTCONFIG"' \
13 | --field="Create New Config File":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-menu-functions; NEWCONFIG"' \
14 | --field="Load Config File":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-menu-functions; LOADCONFIG"' \
15 | --field="Delete Config File":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-menu-functions; DELETECONFIG"' \
16 | --field="Update Sound Card":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-menu-functions; SOUND"' \
17 | --button="Main Menu":1
18 | BUT=$?
19 |
20 | if [ $BUT = 1 ]; then
21 | $MAIN &
22 | exit
23 | fi
24 |
25 | echo $?
--------------------------------------------------------------------------------
/manage-menu-functions:
--------------------------------------------------------------------------------
1 |
2 |
3 | MYPATH=$HOME/patmenu2
4 | MAIN=$MYPATH/./manage-menu
5 | LOGO=$MYPATH/pmlogo.png
6 |
7 | NEWCONFIG(){
8 | source $MYPATH/config
9 | CONFIGTMP=$MYPATH/config.temp
10 |
11 | SETTINGS=$(yad --form --width=600 --text-align=center --center --title="Pat Menu Settings" --text-align=center \
12 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
13 | --text="Pat Menu Settings by KM4ACK" \
14 | --field="Call Sign" "$MYCALLSIGN" \
15 | --field="MAP":CB "usa|world" \
16 | --field="Rig Control":CB "no|yes" \
17 | --field="ARDOP Command" "$ARDOP" \
18 | --field="ARDOP GUI Command" "$ARDOPGUI" \
19 | --field="Direwolf Command" "$DIREWOLF" \
20 | --field="KISS Command" "$KISS" \
21 | --field="AX25 Port" "$AXP" \
22 | --field="Rig Control Command" "$RIG" \
23 | --field="HF Mode for Radio" "$MODEHF" \
24 | --field="2M Mode for Radio" "$MODE2M" \
25 | --field="Pat Port" "$PORT" \
26 | --field="Log File Location" "$LOG" \
27 | --field="AmRRON":CB "no|yes" \
28 | --field="Custom Warning":CB "no|yes" \
29 | --field="Warning Message" "$WARNMSG" \
30 | --button="Create":2 \
31 | --button="Cancel":1)
32 | BUT=$?
33 | if [ $BUT = 1 ]; then
34 | $MAIN
35 | elif [ $BUT = 252 ]; then
36 | exit
37 | elif [ $BUT = 2 ]; then
38 | MYCALLSIGN=$(echo $SETTINGS | awk -F "|" '{print $1}')
39 | MAP=$(echo $SETTINGS | awk -F "|" '{print $2}')
40 | RIGCONTROL=$(echo $SETTINGS | awk -F "|" '{print $3}')
41 | ARDOP=$(echo $SETTINGS | awk -F "|" '{print $4}')
42 | ARDOPGUI=$(echo $SETTINGS | awk -F "|" '{print $5}')
43 | DIREWOLF=$(echo $SETTINGS | awk -F "|" '{print $6}')
44 | KISS=$(echo $SETTINGS | awk -F "|" '{print $7}')
45 | AXP=$(echo $SETTINGS | awk -F "|" '{print $8}')
46 | RIG=$(echo $SETTINGS | awk -F "|" '{print $9}')
47 | MODEHF=$(echo $SETTINGS | awk -F "|" '{print $10}')
48 | MODE2M=$(echo $SETTINGS | awk -F "|" '{print $11}')
49 | PORT=$(echo $SETTINGS | awk -F "|" '{print $12}')
50 | LOG=$(echo $SETTINGS | awk -F "|" '{print $13}')
51 | AMRRON=$(echo $SETTINGS | awk -F "|" '{print $14}')
52 | WARN=$(echo $SETTINGS | awk -F "|" '{print $15}')
53 | WARNMSG=$(echo $SETTINGS | awk -F "|" '{print $16}')
54 |
55 | NAME=$(yad --form --width=600 --text-align=center --center --title="Name?" --text-align=center \
56 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
57 | --text="Pat Menu Settings by KM4ACK" \
58 | --field="New Config Name")
59 | BUT=$?
60 | if [ $BUT = 1 ]; then
61 | $MAIN &
62 | exit
63 | else
64 | NEWCONFIG=$(echo $NAME | awk -F "|" '{print $1}')
65 | fi
66 |
67 | #NEWCONFIG=$(echo $SETTINGS | awk -F "|" '{print $15}')
68 | #NEWCONFIG=$(echo $NEWCONFIG | tr -d "[:blank:]")
69 | NEWCONFIG=$(echo $NEWCONFIG | sed 's/ /./g')
70 | NEWCONFIG=$NEWCONFIG.config
71 |
72 | echo "#Config file for Pat Menu" > $CONFIGTMP
73 | echo "#20200429 KM4ACK" >> $CONFIGTMP
74 | echo "MYCALLSIGN=$MYCALLSIGN" >> $CONFIGTMP
75 | echo "MAP=$MAP" >> $CONFIGTMP
76 | echo "RIGCONTROL=$RIGCONTROL" >> $CONFIGTMP
77 | echo "ARDOP=\"$ARDOP\"" >> $CONFIGTMP
78 | echo "ARDOPGUI=\"$ARDOPGUI\"" >> $CONFIGTMP
79 | echo "DIREWOLF=\"$DIREWOLF\"" >> $CONFIGTMP
80 | echo "KISS=\"$KISS\"" >> $CONFIGTMP
81 | echo "AXP=$AXP" >> $CONFIGTMP
82 | echo "RIG=\"$RIG\"" >> $CONFIGTMP
83 | echo "MODEHF=$MODEHF" >> $CONFIGTMP
84 | echo "MODE2M=$MODE2M" >> $CONFIGTMP
85 | echo "PORT=$PORT" >> $CONFIGTMP
86 | echo "LOG=$LOG" >> $CONFIGTMP
87 | echo "AMRRON=$AMRRON" >> $CONFIGTMP
88 | echo "WARN=$WARN" >> $CONFIGTMP
89 | echo "WARNMSG=\"$WARNMSG\"" >> $CONFIGTMP
90 | CHECKFILE=$(ls $MYPATH | grep $NEWCONFIG)
91 | if [ -z "$CHECKFILE" ];then
92 | cp $CONFIGTMP $MYPATH/$NEWCONFIG
93 | rm $CONFIGTMP
94 | else
95 | echo "FILE ALREADY EXISTS" ######################
96 | yad --form --width=600 --text-align=center --center --title="Pat Menu Settings" --text-align=center \
97 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
98 | --text="\r\rFile already exist!\rOverwrite existing config file?" \
99 | --button="Yes":2 \
100 | --button="No":1
101 | BUT=$?
102 | if [ $BUT = 1 ]; then
103 | $MAIN &
104 | exit
105 | elif [ $BUT = 2 ]; then
106 | cp $CONFIGTMP $MYPATH/$NEWCONFIG
107 | rm $CONFIGTMP
108 | fi
109 |
110 | fi
111 | yad --title="Config Created" --width=400 --height=200 \
112 | --image $LOGO --window-icon=$LOGO --image-on-top \
113 | --center --text="$NEWCONFIG created\r\rDon't forget to load the new config file" \
114 | --button=gtk-ok
115 | $MAIN &
116 | exit
117 | fi
118 | }
119 |
120 | LOADCONFIG(){
121 | OUTFILE=/run/user/$UID/configlist.tmp
122 |
123 | ls $MYPATH/ | grep .config > $OUTFILE
124 |
125 | INFO=$(PARSER='OFS="\n" {print $1}'
126 |
127 | tail -10 $OUTFILE | awk "$PARSER" | \
128 | yad --title="Load Config" --width=400 --height=500 \
129 | --image $LOGO --window-icon=$LOGO --image-on-top \
130 | --center --list --text="Choose Config File to load" \
131 | --column Config-files \
132 | --button="Cancel":1 \
133 | --button="Load Config File":2)
134 | BUT=$?
135 | NEWCONFIG=$(echo $INFO | awk -F "|" '{print $1}')
136 | echo $NEWCONFIG
137 | echo $BUT
138 |
139 | if [ $BUT = 252 ]; then
140 | exit
141 | elif [ $BUT = 1 ]; then
142 | $MAIN
143 | exit
144 | elif [ $BUT = 2 ]; then
145 | if [ -z $NEWCONFIG ]; then
146 | $MAIN &
147 | exit
148 | else
149 | cp $MYPATH/$NEWCONFIG $MYPATH/config
150 | echo "CONF=$NEWCONFIG" > $MYPATH/.currentconf #write config file name to a file
151 | rm $OUTFILE
152 | yad --title="Config Loaded" --width=400 --height=200 \
153 | --image $LOGO --window-icon=$LOGO --image-on-top \
154 | --center --text="$NEWCONFIG loaded" \
155 | --button=gtk-ok
156 | $MAIN &
157 | exit
158 | fi
159 | fi
160 | }
161 |
162 | CURRENTCONFIG(){
163 | source $MYPATH/config
164 | CONFIGTMP=$MYPATH/config.temp
165 | CONFIG=$MYPATH/config
166 |
167 | if [ "$MAP" = 'usa' ]; then
168 | MAP="usa|world"
169 | else
170 | MAP="world|usa"
171 | fi
172 |
173 | if [ "$RIGCONTROL" = 'yes' ]; then
174 | RIGCONTROL="yes|no"
175 | else
176 | RIGCONTROL="no|yes"
177 | fi
178 |
179 | if [ "$AMRRON" = 'yes' ]; then
180 | AMRRON="yes|no"
181 | else
182 | AMRRON="no|yes"
183 | fi
184 |
185 | if [ "$WARN" = 'yes' ]; then
186 | WARN="yes|no"
187 | else
188 | WARN="no|yes"
189 | fi
190 |
191 | SETTINGS=$(yad --form --width=600 --text-align=center --center --title="Pat Menu Settings" --text-align=center \
192 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
193 | --text="Pat Menu Settings by KM4ACK" \
194 | --field="Call Sign" "$MYCALLSIGN" \
195 | --field="MAP":CB "$MAP" \
196 | --field="Rig Control":CB "$RIGCONTROL" \
197 | --field="ARDOP Command" "$ARDOP" \
198 | --field="ARDOP GUI Command" "$ARDOPGUI" \
199 | --field="Direwolf Command" "$DIREWOLF" \
200 | --field="KISS Command" "$KISS" \
201 | --field="AX25 Port" "$AXP" \
202 | --field="Rig Control Command" "$RIG" \
203 | --field="HF Mode for Radio" "$MODEHF" \
204 | --field="2M Mode for Radio" "$MODE2M" \
205 | --field="Pat Port" "$PORT" \
206 | --field="Log File Location" "$LOG" \
207 | --field="AmRRON":CB "$AMRRON" \
208 | --field="Custom Warning":CB "$WARN" \
209 | --field="Warning Message" "$WARNMSG" \
210 | --button="Save As":3 \
211 | --button="Update":2 \
212 | --button="Cancel":1)
213 | BUT=$?
214 |
215 | if [ $BUT = 1 ]; then
216 | $MAIN
217 | elif [ $BUT = 252 ]; then
218 | exit
219 | elif [ $BUT = 2 ]; then
220 | MYCALLSIGN=$(echo $SETTINGS | awk -F "|" '{print $1}')
221 | MAP=$(echo $SETTINGS | awk -F "|" '{print $2}')
222 | RIGCONTROL=$(echo $SETTINGS | awk -F "|" '{print $3}')
223 | ARDOP=$(echo $SETTINGS | awk -F "|" '{print $4}')
224 | ARDOPGUI=$(echo $SETTINGS | awk -F "|" '{print $5}')
225 | DIREWOLF=$(echo $SETTINGS | awk -F "|" '{print $6}')
226 | KISS=$(echo $SETTINGS | awk -F "|" '{print $7}')
227 | AXP=$(echo $SETTINGS | awk -F "|" '{print $8}')
228 | RIG=$(echo $SETTINGS | awk -F "|" '{print $9}')
229 | MODEHF=$(echo $SETTINGS | awk -F "|" '{print $10}')
230 | MODE2M=$(echo $SETTINGS | awk -F "|" '{print $11}')
231 | PORT=$(echo $SETTINGS | awk -F "|" '{print $12}')
232 | LOG=$(echo $SETTINGS | awk -F "|" '{print $13}')
233 | AMRRON=$(echo $SETTINGS | awk -F "|" '{print $14}')
234 | WARN=$(echo $SETTINGS | awk -F "|" '{print $15}')
235 | WARNMSG=$(echo $SETTINGS | awk -F "|" '{print $16}')
236 |
237 | echo "#Config file for Pat Menu" > $CONFIGTMP
238 | echo "#20200429 KM4ACK" >> $CONFIGTMP
239 | echo "MYCALLSIGN=$MYCALLSIGN" >> $CONFIGTMP
240 | echo "MAP=$MAP" >> $CONFIGTMP
241 | echo "RIGCONTROL=$RIGCONTROL" >> $CONFIGTMP
242 | echo "ARDOP=\"$ARDOP\"" >> $CONFIGTMP
243 | echo "ARDOPGUI=\"$ARDOPGUI\"" >> $CONFIGTMP
244 | echo "DIREWOLF=\"$DIREWOLF\"" >> $CONFIGTMP
245 | echo "KISS=\"$KISS\"" >> $CONFIGTMP
246 | echo "AXP=$AXP" >> $CONFIGTMP
247 | echo "RIG=\"$RIG\"" >> $CONFIGTMP
248 | echo "MODEHF=$MODEHF" >> $CONFIGTMP
249 | echo "MODE2M=$MODE2M" >> $CONFIGTMP
250 | echo "PORT=$PORT" >> $CONFIGTMP
251 | echo "LOG=$LOG" >> $CONFIGTMP
252 | echo "AMRRON=$AMRRON" >> $CONFIGTMP
253 | echo "WARN=$WARN" >> $CONFIGTMP
254 | echo "WARNMSG=\"$WARNMSG\"" >> $CONFIGTMP
255 | cp $CONFIGTMP $CONFIG
256 | rm $CONFIGTMP
257 | $MAIN &
258 | exit
259 | elif [ $BUT = 3 ]; then
260 | NEWNAME=$(yad --form --width=600 --text-align=center --center --title="Name?" --text-align=center \
261 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
262 | --text="Pat Menu Settings by KM4ACK" \
263 | --field="New Config Name")
264 | BUT=$?
265 | if [ $BUT = 1 ]; then
266 | $MAIN & exit
267 | elif [ $BUT = 252 ]; then
268 | exit
269 | fi
270 |
271 | NEWNAME=$(echo $NEWNAME | awk -F "|" '{print $1}')
272 | NEWNAME=$NEWNAME.config #add .config to filename
273 | NEWNAME=$(echo $NEWNAME | sed 's/ /-/g') #remove spaces in file name
274 |
275 | cp $CONFIG $HOME/patmenu2/$NEWNAME
276 |
277 | yad --title="Config Created" --width=400 --height=200 \
278 | --image $LOGO --window-icon=$LOGO --image-on-top \
279 | --center --text="$NEWNAME created\r\rDon't forget to load the new config file" \
280 | --button=gtk-ok
281 | $MAIN &
282 | exit
283 | fi
284 | }
285 |
286 | DELETECONFIG(){
287 | TEMPFILE=$MYPATH/config.tmp
288 |
289 | FILES=$(ls $MYPATH | grep .config)
290 |
291 | echo $FILES | awk 'BEGIN { OFS = "\n" }{ print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 }' > $TEMPFILE
292 |
293 | CONFIG=$(PARSER='OFS="\n" {print $1}'
294 |
295 | tail -50 $TEMPFILE | awk "$PARSER" | \
296 | yad --title="Config Delete" --width=1100 --height=500 --separator=" " --item-separator="|" \
297 | --image $LOGO --window-icon=$LOGO --image-on-top \
298 | --center --list --text="Config Delete" \
299 | --column Config-Files \
300 | --button=gtk-close \
301 | --button="Delete Config":2)
302 | BUT=$?
303 |
304 | if [ $BUT = 0 ]; then
305 | $MAIN &
306 | rm $TEMPFILE
307 | exit
308 | elif [ $BUT = 252 ]; then
309 | rm $TEMPFILE
310 | exit
311 | fi
312 | FILE=$(echo $CONFIG | awk -F "|" '{print $1}')
313 | rm $MYPATH/$FILE
314 | rm $TEMPFILE
315 |
316 | yad --title="Deleted" --width=400 --height=100 \
317 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
318 | --center --form --text="$FILE has been deleted" \
319 | --button=gtk-ok
320 |
321 | $MAIN &
322 | exit
323 |
324 | }
325 |
326 | SOUND(){
327 | CARD=$(arecord -l | grep card | awk '{print $2}' | sed 's/://')
328 | DIRECARD=$(cat $HOME/direwolf.conf | grep ADEVICE | head -1 | awk '{print $2}' | sed 's/plughw://' | sed 's/,.*$//')
329 | PATCARD=$(cat $HOME/patmenu2/config | grep ARDOP | head -1 | awk '{print $3}' | sed 's/plughw://' | sed 's/,.*$//')
330 |
331 |
332 | sed -i "0,/$DIRECARD,0/{s//$CARD,0/}" $HOME/direwolf.conf
333 | sed -i "s/$PATCARD,0/$CARD,0/g" $HOME/patmenu2/config
334 |
335 |
336 | yad --title="Sound Card" --width=400 --height=100 \
337 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
338 | --center --form --text="\r\r\r\rSound card data has been updated\rfor both Packet and ARDOP modems." \
339 | --button=gtk-ok
340 |
341 | $MAIN &
342 | exit
343 | }
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
--------------------------------------------------------------------------------
/manage-pat:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | export MYPATH=$HOME/patmenu2
4 | LOGO=$MYPATH/pmlogo.png
5 | source $MYPATH/manage-pat-functions
6 | MAIN=$MYPATH/patmenu
7 | CUR=$(cat $MYPATH/.autostart.conf | awk -F "/" '{print $NF}' | sed 's/"//')
8 |
9 | if [ -z "$CUR" ]; then
10 | CUR=None
11 | else
12 | #set pretty name for display
13 | if [ $CUR = 'start-vara-hf' ]; then
14 | CUR=VARA-HF
15 | elif [ $CUR = 'start-vara-fm' ]; then
16 | CUR=VARA-FM
17 | elif [ $CUR = 'start-pat-ardop' ]; then
18 | CUR=ARDOP
19 | elif [ $CUR = 'start-pat2m' ]; then
20 | CUR=Packet
21 | fi
22 | fi
23 |
24 | yad --form --width=420 --text-align=center --center --title="Manage Pat" --text-align=center \
25 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
26 | --text="Manage Pat by KM4ACK" \
27 | --field="Pat Login-Logout":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; LOGIN"' \
28 | --field="GPS Grid Update":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; GPSGRID"' \
29 | --field="Manual Grid Update":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; MANUALGPS"' \
30 | --field="Set ARDOP Speed":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; SPEED"' \
31 | --field="Set ARDOP PTT":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; SETPTT"' \
32 | --field="Set Listen Mode":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; LISTEN"' \
33 | --field="Add P2P Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; PEER"' \
34 | --field="Auto Start Modem - $CUR":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; AUTOMODEM"' \
35 | --field="Delete Alias":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; DELETEALIAS"' \
36 | --field="Backup Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; BKUPCONFIG"' \
37 | --field="Restore Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; RESTORECONFIG"' \
38 | --field="Repair Pat Config":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/manage-pat-functions; REPAIRCONFIG"' \
39 | --button="Main Menu":1
40 | BUT=$?
41 |
42 | if [ $BUT = 1 ]; then
43 | $MAIN &
44 | exit
45 | fi
--------------------------------------------------------------------------------
/manage-pat-functions:
--------------------------------------------------------------------------------
1 |
2 | MYPATH=$HOME/patmenu2
3 | MAIN=$MYPATH/./manage-pat
4 | LOGO=$MYPATH/pmlogo.png
5 |
6 | DELETEALIAS(){
7 |
8 | PATCONFIG=$XDG_CONFIG_HOME/pat/config.json
9 | OUTFILE=/run/user/$UID/currentlist.txt
10 | TEMP=/run/user/$UID/patconfig.txt
11 | WHO=$(whoami)
12 |
13 | jq .connect_aliases $PATCONFIG | sed '/^}/d' | sed '/^{/d' | sed 's/^ *//g' > $OUTFILE
14 |
15 | cat $OUTFILE
16 |
17 | sed -i 's/"//g' $OUTFILE
18 | sed -i 's/,//g' $OUTFILE
19 | sed -i 's/://' $OUTFILE
20 | echo;echo
21 | cat $OUTFILE | awk 'OFS="\n" {print $1, $2}'
22 |
23 |
24 |
25 | REMOVE=$(PARSER='OFS="\n" {print $1, $2}'
26 |
27 | tail -50 $OUTFILE | awk "$PARSER" | \
28 | yad --title="Current Alias List" --width=1100 --height=500 \
29 | --image $LOGO --window-icon=$LOGO --image-on-top \
30 | --center --list --text="Select Alias to Delete" \
31 | --column Call --column INFO \
32 | --button="Delete Alias":2 \
33 | --button="Cancel":1)
34 | BUT=$?
35 | if [ $BUT = 1 ]; then
36 | $MAIN &
37 | exit
38 | elif [ $BUT = 252 ]; then
39 | exit
40 | fi
41 | RCALL=$(echo $REMOVE | awk -F "|" '{print $1}')
42 | RCALL1=$(echo "\"$RCALL\"")
43 | #check something was selected
44 | if [ -z "$RCALL" ]; then
45 | yad --title="No Selection" --width=300 --height=100 \
46 | --image $LOGO --window-icon=$LOGO --image-on-top \
47 | --center --form --text="No station was selected\r Please try again" \
48 | --button=gtk-ok
49 | $MAIN &
50 | exit
51 | fi
52 | jq 'del(.connect_aliases.'$RCALL1')' $PATCONFIG > $TEMP
53 | cp $TEMP $PATCONFIG
54 | rm $TEMP $OUTFILE
55 | sudo killall pat
56 | sudo systemctl start pat@$WHO
57 | yad --title="Alias Deleted" --width=400 --height=200 \
58 | --image $LOGO --window-icon=$LOGO --image-on-top \
59 | --center --text="$RCALL1 Alias DELETED" \
60 | --button=gtk-ok
61 | $MAIN &
62 | exit
63 | }
64 |
65 | LOGIN(){
66 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
67 | WHO=$(whoami)
68 | CURRENT_USER=$(grep mycall $CONFIG | head -1 | sed 's/"mycall": "//;s/ //g;s/",//')
69 |
70 |
71 | USER=$(yad --form --width=420 --text-align=center --center --title="Pat Log In/Out" --text-align=center \
72 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
73 | --text="Pat Log In/Out by KM4ACK" \
74 | --field="Call Sign" "" \
75 | --field="Winlink Password" "" \
76 | --field="Six Character Grid Square" "EM65TV" \
77 | --field="Current User Logged In ---- $CURRENT_USER":LBL \
78 | --button="Log In":2 \
79 | --button="Log Out":3 \
80 | --button="Cancel":1)
81 | BUT=$?
82 |
83 | if [ $BUT = 252 ]; then
84 | exit
85 | elif [ $BUT = 1 ]; then
86 | $MAIN
87 | elif [ $BUT = 2 ]; then
88 | echo "Log IN"
89 | CALLSIGN=$(echo $USER | awk -F "|" '{print $1}')
90 | CALLSIGN=$(echo "${CALLSIGN^^}")
91 | PASS=$(echo $USER | awk -F "|" '{print $2}')
92 | GRID=$(echo $USER | awk -F "|" '{print $3}')
93 | GRID=$(echo "${GRID^^}")
94 | echo "$CALLSIGN $PASS $GRID"
95 | #set callsign
96 | sed -i "s/\"mycall\": \".*\",/\"mycall\": \"$CALLSIGN\",/" $CONFIG
97 | #set password
98 | sed -i "s/\"secure_login_password\": \".*\",/\"secure_login_password\": \"$PASS\",/" $CONFIG
99 | #set locator
100 | sed -i "s/\"locator\": \".*\",/\"locator\": \"$GRID\",/" $CONFIG
101 | sudo systemctl restart pat@$WHO
102 | $MAIN &
103 | exit
104 | elif [ $BUT = 3 ]; then
105 | echo "Log OUT"
106 | CALLSIGN=N0CALL
107 | PASS=""
108 | GRID=""
109 | #set callsign
110 | sed -i "s/\"mycall\": \".*\",/\"mycall\": \"$CALLSIGN\",/" $CONFIG
111 | #set password
112 | sed -i "s/\"secure_login_password\": \".*\",/\"secure_login_password\": \"$PASS\",/" $CONFIG
113 | #set locator
114 | sed -i "s/\"locator\": \".*\",/\"locator\": \"$GRID\",/" $CONFIG
115 | sudo killall pat
116 | $MAIN &
117 | exit
118 | fi
119 |
120 | }
121 |
122 | GPSGRID(){
123 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
124 | RUBY_INSTALLED=$(which ruby)
125 |
126 | if [ -z "$RUBY_INSTALLED" ]; then
127 | yad --form --width=300 --text-align=center --center --title="Ruby not Found" --text-align=center \
128 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
129 | --text="Ruby is needed to read GPS data but not found installed on your system. Would you like to install it now?" \
130 | --button="Install Ruby":2 \
131 | --button="Cancel":1
132 | BUT=$?
133 | if [ $BUT = 1 ]; then
134 | $MAIN &
135 | exit
136 | elif [ $BUT = 2 ]; then
137 | INSTALLRUBY(){
138 | sudo apt-get update
139 | sudo apt-get install -y ruby2.5
140 | sudo gem install gpsd_client
141 | sudo gem install maidenhead
142 | }
143 | INSTALLRUBY | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center \
144 | --text="Installing Ruby. This will take several minutes\rDO NOT CLOSE THIS WINDOW\rDoing so will abort the install."
145 | fi
146 | fi
147 |
148 | yad --center --timeout=5 --timeout-indicator=top \
149 | --auto-close --no-buttons --text="Getting grid from GPS" &
150 |
151 | NEWGRID=$($MYPATH/getgrid | cut -b 1-6)
152 |
153 | if [ "$NEWGRID" = 'JJ00aa' ]; then
154 | NEWGRID="GPS READ ERROR or NO LOCK"
155 | yad --form --width=400 --text-align=center --center --title="GPS ERROR" --text-align=center \
156 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
157 | --text="Update Pat Grid by KM4ACK\r\rGPS ERROR" \
158 | --field="Grid read from GPS":RO "$NEWGRID" \
159 | --button=gtk-quit
160 | $MAIN &
161 | exit
162 | fi
163 |
164 | yad --form --width=200 --text-align=center --center --title="Update Grid" --text-align=center \
165 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
166 | --text="Update Pat Grid by KM4ACK" \
167 | --field="Grid read from GPS":RO "$NEWGRID" \
168 | --button="Update Pat":2 \
169 | --button="Cancel":1
170 | BUT=$?
171 | if [ $BUT = 1 ]; then
172 | $MAIN &
173 | exit
174 | elif [ $BUT = 2 ]; then
175 | sed -i "s/\"locator\": \".*\",/\"locator\": \"$NEWGRID\",/" $CONFIG
176 | yad --center --timeout=2 --timeout-indicator=top \
177 | --auto-close --no-buttons --text="Grid Square Updated"
178 | $MAIN &
179 | exit
180 | fi
181 | }
182 |
183 | RESTORECONFIG(){
184 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
185 | OUTFILE=/run/user/$UID/config.list
186 | WHO=$(whoami)
187 |
188 | ls $XDG_CONFIG_HOME/pat/ | grep .bkup > $OUTFILE
189 |
190 | INFO=$(PARSER='OFS="\n" {print $1}'
191 |
192 | tail -10 $OUTFILE | awk "$PARSER" | \
193 | yad --title="Restore Config" --width=1100 --height=500 \
194 | --image $LOGO --window-icon=$LOGO --image-on-top \
195 | --center --list --text="Choose File to Restore" \
196 | --column File-to-Restore \
197 | --button="Cancel":1 \
198 | --button="Restore File":2)
199 | BUT=$?
200 |
201 | if [ $BUT = 252 ]; then
202 | exit
203 | elif [ $BUT = 1 ]; then
204 | $MAIN
205 | exit
206 | fi
207 | FILE=$(echo $INFO | awk -F "|" '{print $1}')
208 | cp $XDG_CONFIG_HOME/pat/$FILE $CONFIG
209 | sudo killall pat
210 | sudo systemctl start pat@$WHO
211 | yad --form --width=420 --text-align=center --center --title="Config Restore" --text-align=center \
212 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
213 | --text="Config Restore by KM4ACK\r\rRESTROE COMPLETE" \
214 | --button=gtk-ok
215 | $MAIN
216 |
217 | }
218 |
219 | BKUPCONFIG(){
220 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
221 | WHO=$(whoami)
222 | DATE=$(date +%d%b%Y-%H%M)
223 |
224 | yad --form --width=420 --text-align=center --center --title="Backup Config" --text-align=center \
225 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
226 | --text="Backup Pat Config by KM4ACK" \
227 | --button="Backup Config":2 \
228 | --button="Main Menu":1
229 | BUT=$?
230 | if [ $BUT = 1 ]; then
231 | $MAIN &
232 | exit
233 | elif [ $BUT = 252 ]; then
234 | exit
235 | elif [ $BUT = 2 ]; then
236 | echo "Backing up file"
237 | BKUPCONFIG=config.$DATE.bkup
238 | cp $CONFIG $XDG_CONFIG_HOME/pat/$BKUPCONFIG
239 | yad --form --width=420 --text-align=center --center --title="Config Backup" --text-align=center \
240 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
241 | --text="Config File Backup by KM4ACK\r\rBackup COMPLETE" \
242 | --button=gtk-ok
243 | fi
244 | $MAIN
245 | }
246 |
247 | SPEED(){
248 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
249 | CURRENT=$(cat $CONFIG | grep -i max | sed 's/"Max":\ //' | tr -d "[:blank:]")
250 | WHO=$(whoami)
251 | NEW=$(yad --form --width=320 --text-align=center --center --title="Speed" --text-align=center \
252 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
253 | --text="Current ARDOP Speed is $CURRENT" \
254 | --field="Set ARDOP Speed to":CB "200|500|1000|2000" \
255 | --button="Cancel":1 \
256 | --button="Set Speed":2)
257 | BUT=$?
258 | if [ $BUT = 1 ]; then
259 | $MAIN &
260 | exit
261 | elif [ $BUT = 252 ]; then
262 | exit
263 | fi
264 | NEW=$(echo $NEW | awk -F "|" '{print $1}')
265 |
266 | sed -i "s/\"Max\":.*/ \"Max\": $NEW/" $CONFIG
267 | sudo killall pat
268 | sudo systemctl start pat@$WHO
269 | yad --form --width=320 --text-align=center --center --title="Speed" --text-align=center \
270 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
271 | --text="ARDOP Speed set to $NEW" \
272 | --button=gtk-ok
273 | $MAIN &
274 | exit
275 | }
276 |
277 | SETPTT(){
278 |
279 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
280 | WHO=$(whoami)
281 |
282 | CURRENT=$(cat $CONFIG | grep ptt_ctrl | tail -1 | sed 's/"ptt_ctrl":\ //' | sed 's/,//' | tr -d "[:blank:]")
283 | if [ $CURRENT = 'false' ]; then
284 | CURRENT1="false|true"
285 | elif [ $CURRENT = 'true' ]; then
286 | CURRENT1="true|false"
287 | fi
288 |
289 | PTT=$(yad --form --width=400 --text="Current Pat ARDOP PTT = $CURRENT" --text-align=center --center --title="Set PTT" --text-align=center \
290 | --separator="|" --item-separator="|" \
291 | --image=$LOGO --window-icon=$LOGO --image-on-top \
292 | --field="ARDOP PTT":CB "$CURRENT1" \
293 | --button="Set PTT":2 \
294 | --button="Cancel":1)
295 | QUIT=$?
296 | if [ $QUIT = 1 ]; then
297 | $MAIN &
298 | exit
299 | elif [ $QUIT = 252 ]; then
300 | exit
301 | fi
302 |
303 | ANS=$(echo $PTT | awk -F "|" '{print $1}')
304 | CURRENT=$(cat $CONFIG | grep ptt_ctrl | tail -1 | sed 's/"ptt_ctrl":\ //' | sed 's/,//')
305 |
306 | echo "Set $CURRENT to $ANS"
307 |
308 | if [ $CURRENT = 'false' ]; then
309 | sed -i "s/\"ptt_ctrl\":\ false,/\"ptt_ctrl\":\ $ANS,/" $CONFIG
310 | elif [ $CURRENT = 'true' ]; then
311 | sed -i "s/\"ptt_ctrl\":\ true,/\"ptt_ctrl\":\ $ANS,/" $CONFIG
312 | fi
313 | sudo killall pat
314 | sudo systemctl start pat@$WHO
315 |
316 |
317 | yad --form --width=400 --text-align=center --center --title="Set PTT" --text-align=center \
318 | --separator="|" --item-separator="|" \
319 | --image=$LOGO --window-icon=$LOGO --image-on-top \
320 | --text="Pat ARDOP PTT now set to $ANS" \
321 | --button=gtk-ok
322 | $MAIN &
323 | exit
324 |
325 | }
326 |
327 | MANUALGPS() {
328 |
329 | WHO=$(whoami)
330 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
331 | CURRENT_GRID=$(grep locator $CONFIG | sed 's/"locator": "//;s/ //g;s/",//')
332 |
333 | GRID=$(yad --form --width=400 --text-align=center --center --title="Set Grid" --text-align=center \
334 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
335 | --text="Update Pat Grid by KM4ACK" \
336 | --field="Six Character Grid": "$NEWGRID" \
337 | --field="Current Grid -------- $CURRENT_GRID":LBL \
338 | --button="Update Grid":2 \
339 | --button="Cancel":1)
340 | BUT=$?
341 |
342 | if [ $BUT = 252 ]; then
343 | exit
344 | fi
345 |
346 | if [ $BUT = 1 ]; then
347 | $MAIN &
348 | exit
349 | fi
350 |
351 | NEWGRID=$(echo $GRID | awk -F "|" '{print $1}')
352 |
353 | NEWGRID=${NEWGRID^^}
354 |
355 |
356 | sed -i "s/\"locator\": \".*\",/\"locator\": \"$NEWGRID\",/" $CONFIG
357 | echo "GRID UPDATED"
358 | sudo killall pat
359 | sudo systemctl start pat@$WHO
360 | yad --form --width=400 --text-align=center --center --title="Grid Update" --text-align=center \
361 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
362 | --text="Grid Updated to $NEWGRID" \
363 | --button=gtk-ok
364 |
365 | $MAIN
366 | }
367 |
368 | LISTEN(){
369 | #This funtion sets the listen modes for Pat Winlink
370 | WHO=$(whoami)
371 | TEMP=/run/user/$UID/listen.txt
372 | NOW=$(grep ExecStart /lib/systemd/system/pat@.service | sed 's|ExecStart=/usr/bin/pat -l||;s/http//')
373 | if [ $NOW = 'ExecStart=/usr/bin/pat' ]; then
374 | NOW="Not listening for incoming connections"
375 | fi
376 |
377 | LISTEN=$(yad --center --list --checklist --width=600 --height=300 --separator="|" \
378 | --image $LOGO --column=Check --column=Mode --column=Description \
379 | --print-column=2 --window-icon=$LOGO --image-on-top --text-align=center \
380 | --text="Pat Listen Modes\rCurrently Listening on:\r$NOW" --title="Pat Menu" \
381 | false "TELNET" "Connection over Internet or Mesh" \
382 | false "AX25" "Packet Connections 2M-440" \
383 | false "ARDOP" "HF Connections using ARDOP Modem" \
384 | --button="Main Menu":1 \
385 | --button="Set Listen Mode":2 \
386 | --button="Stop Listening":3)
387 | BUT=$?
388 | if [ $BUT = 252 ]; then
389 | exit
390 | elif [ $BUT = 1 ]; then
391 | $MAIN &
392 | exit
393 | elif [ $BUT = 2 ]; then
394 | #Send results to temp file.
395 | echo $LISTEN > $TEMP
396 | #check temp file for what's there
397 | TELNET=$(grep TELNET $TEMP)
398 | ARDOP=$(grep ARDOP $TEMP)
399 | AX25=$(grep AX25 $TEMP)
400 | #Set telnet variable
401 | if [ -n "$TELNET" ]; then
402 | TELNET="telnet,"
403 | fi
404 | #set ardop variable
405 | if [ -n "$ARDOP" ]; then
406 | ARDOP="ardop,"
407 | fi
408 | #set ax25 variable
409 | if [ -n "$AX25" ]; then
410 | AX25="ax25,"
411 | fi
412 | cat < $TEMP
413 | [Unit]
414 | Description=pat - Winlink client for %I
415 | Documentation=https://github.com/la5nta/pat/wiki
416 | After=ax25.service network.target
417 |
418 | [Service]
419 | User=%i
420 | ExecStart=/usr/bin/pat http
421 | Restart=on-failure
422 |
423 | [Install]
424 | WantedBy=multi-user.target
425 | EOF
426 | #add listen modes set by user
427 | sed -i "s|Exec.*|ExecStart=/usr/bin/pat -l $TELNET$ARDOP$AX25 http|" $TEMP
428 | sudo cp $TEMP /lib/systemd/system/pat@.service
429 | sudo systemctl daemon-reload
430 | sudo systemctl restart pat@$WHO
431 | yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \
432 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
433 | --text="Listen mode set to $TELNET$ARDOP$AX25" \
434 | --button=gtk-ok
435 | $MAIN &
436 | exit
437 |
438 | elif [ $BUT = 3 ]; then
439 | cat < $TEMP
440 | [Unit]
441 | Description=pat - Winlink client for %I
442 | Documentation=https://github.com/la5nta/pat/wiki
443 | After=ax25.service network.target
444 |
445 | [Service]
446 | User=%i
447 | ExecStart=/usr/bin/pat http
448 | Restart=on-failure
449 |
450 | [Install]
451 | WantedBy=multi-user.target
452 | EOF
453 | sudo cp $TEMP /lib/systemd/system/pat@.service
454 | sudo systemctl daemon-reload
455 | sudo systemctl restart pat@$WHO
456 | fi
457 | yad --form --width=320 --text-align=center --center --title="Listening" --text-align=center \
458 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
459 | --text="No longer listening for incoming connections" \
460 | --button=gtk-ok
461 | $MAIN &
462 | exit
463 | }
464 |
465 | REPAIRCONFIG(){
466 | DIR=/run/user/$UID
467 | WHO=$(whoami)
468 |
469 | FILECHECK=$(ls $DIR | grep config.json)
470 | if [ ! -z $FILECHECK ]; then
471 | rm $DIR/config.json*
472 | fi
473 |
474 |
475 | #Verify Pat installed and set path variable if it is
476 | if ! hash pat 2>/dev/null; then
477 | echo "Pat Winlink not found on this system"
478 | exit
479 | else
480 | PATV=$(pat version | awk '{print $2}' | sed 's/v0.//' | awk -F "." '{print $1}')
481 | if [ $PATV -le 11 ]; then
482 | PATPATH=$HOME/.wl2k/
483 | else
484 | PATPATH=$XDG_CONFIG_HOME/pat/
485 | fi
486 | fi
487 |
488 | #user input
489 | SETTINGS=$(yad --form --width=600 --text-align=center --center --title="Repair Config File" --text-align=center \
490 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
491 | --text="Pat Menu\rConfig File Repair\r by KM4ACK" \
492 | --field="Call Sign" "" \
493 | --field="Winlink Password" "" \
494 | --field="Six Character Grid Square" "" \
495 | --field="Allow access to Pat across network?":CB "YES|NO" \
496 | --button="Repair Config File":2 \
497 | --button="Cancel":1)
498 | BUT=$?
499 | if [ $BUT = 1 ]; then
500 | $MAIN
501 | elif [ $BUT = 252 ]; then
502 | exit
503 | fi
504 |
505 | #parse input into variables
506 | CALL=$(echo $SETTINGS | awk -F "|" '{print $1}')
507 | CALL=${CALL^^}
508 | PASSWD=$(echo $SETTINGS | awk -F "|" '{print $2}')
509 | GRID=$(echo $SETTINGS | awk -F "|" '{print $3}')
510 | GRID=${GRID^^}
511 | SECURE=$(echo $SETTINGS | awk -F "|" '{print $4}')
512 |
513 |
514 |
515 | if [ "$SECURE" = 'NO' ]; then
516 | SECURE="127.0.0.1"
517 | else
518 | SECURE="0.0.0.0"
519 | fi
520 |
521 | #check to see if EES is installed and set port accordingly
522 | if [ -f /var/www/html/celladdy.php ]; then
523 | PORT=5000
524 | else
525 | PORT=8080
526 | fi
527 |
528 | #download config.json file from km4ack github
529 | cd $DIR
530 | wget -q https://raw.githubusercontent.com/km4ack/pi-scripts/master/config.json
531 |
532 | #verify download success
533 | if [ $? != 0 ]; then
534 | yad --title="Cannot Download!" --width=300 --height=100 \
535 | --image $LOGO --window-icon=$LOGO --image-on-top \
536 | --center --text="Cannot download new config file.\rCheck internet connection" \
537 | --button=gtk-ok
538 | $MAIN & exit
539 | fi
540 |
541 | #update file with user settings
542 | sed -i "s/N0CALL/$CALL/" $DIR/config.json
543 | sed -i "s/PASSWORD/$PASSWD/" $DIR/config.json
544 | sed -i "s/GRID/$GRID/" $DIR/config.json
545 | sed -i "s/8080/$PORT/" $DIR/config.json
546 | sed -i "s/127.0.0.1/$SECURE/" $DIR/config.json
547 |
548 | #cp file and restart pat
549 | cp $DIR/config.json $PATPATH/
550 | sudo systemctl restart pat@$WHO
551 |
552 | yad --title="Repair Complete" --width=300 --height=100 \
553 | --image $LOGO --window-icon=$LOGO --image-on-top \
554 | --center --text="Config File Repaired" \
555 | --button=gtk-ok
556 | $MAIN & exit
557 | }
558 |
559 | PEER(){
560 | TEMP_DIR=/run/user/$UID
561 | CONFIG=$XDG_CONFIG_HOME/pat/config.json
562 | TEMP_CONFIG=$TEMP_DIR/temp-config.txt
563 | WHO=`whoami`
564 |
565 | #get data from user
566 | PEER=$(yad --center --wrap --width=450 --title="Add P2P Alias" --text-align=center \
567 | --text="Enter the Peer to Peer Details Below\rIf using a hostname, add \".local\" to the end.\rExample: raspberrypi.local" \
568 | --image $LOGO --window-icon=$LOGO --image-on-top \
569 | --button="Update:2" \
570 | --button="Cancel:1" \
571 | --form --separator="|" --item-separator="|" \
572 | --field="Call Sign of Remote Station" \
573 | --field="IP address OR hostname of Remote Station" \
574 | )
575 | BUT=$?
576 | if [ $BUT = 1 ]; then
577 | $MAIN & exit
578 | elif [ $BUT = 252 ]; then
579 | exit
580 | elif [ $BUT = 2 ]; then
581 | #parse info entered above
582 | REMOTE_CALL=$(echo $PEER | awk -F "|" '{print $1}')
583 | REMOTE_CALL=${REMOTE_CALL^^}
584 | IP=$(echo $PEER | awk -F "|" '{print $2}')
585 | #create shortcut
586 | SC="telnet://{mycall}:CMSTelnet@$IP:8774/wl2k"
587 | #mod config file
588 | jq '.connect_aliases += {'\"P2P-"$REMOTE_CALL"-"$IP"\"' : '\"$SC\"'}' $CONFIG > $TEMP_CONFIG
589 | cp $TEMP_CONFIG $CONFIG
590 | sudo systemctl restart pat@$WHO
591 |
592 | #give user notice
593 | yad --form --width=420 --text-align=center --center --title="P2P Alias Add" --text-align=center \
594 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
595 | --text="P2P Alias Added" \
596 | --button=gtk-ok
597 | $MAIN
598 | fi
599 | }
600 |
601 | AUTOMODEM(){
602 | CONF=$HOME/patmenu2/.autostart.conf
603 | HTTP_ADDR=$(grep http_addr $HOME/.config/pat/config.json | sed 's/.*": "//;s/:.*//')
604 |
605 | #pat server check
606 | if [ "$HTTP_ADDR" = '127.0.0.1' ]; then
607 | yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
608 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
609 | --text="The Pat mailbox server is currently set to only accept connections from the Pi itself. \
610 | Typically if using the auto modem start feature, you will be accessing the Pat mailbox from \
611 | another device. Would you like to configure the system to accept connections over the network?" \
612 | --button="Keep Current Settings":1 \
613 | --button="Allow Network Connections":2
614 | BUT=$?
615 | if [ $BUT = 2 ]; then
616 | cp $HOME/.config/pat/config.json $HOME/.config/pat/config.json.bkup
617 | sed -i 's/127.0.0.1/0.0.0.0/' $HOME/.config/pat/config.json
618 | sudo systemctl restart pat@`whoami`
619 | fi
620 | fi
621 |
622 | source $CONF
623 |
624 | #Figure out which modem (if any) is set to auto start already and give it a pretty name.
625 | CUR=$(echo $AUTO_CMD | awk -F "/" '{print $NF}')
626 | if [ -z $CUR ]; then
627 | echo
628 | else
629 | if [ $CUR = 'start-vara-hf' ]; then
630 | CUR=VARA-HF
631 | elif [ $CUR = 'start-vara-fm' ]; then
632 | CUR=VARA-FM
633 | elif [ $CUR = 'start-pat-ardop' ]; then
634 | CUR=ARDOP
635 | elif [ $CUR = 'start-pat2m' ]; then
636 | CUR=Packet
637 | fi
638 | fi
639 |
640 | #check to see if we already have a autostart in place. Give user
641 | #a chance to delete before adding a new one. Can only have one
642 | #modem starting at a time.
643 | if [ -f $CONF ]; then
644 | yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
645 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
646 | --text="Existing Auto Start Found - $CUR\rYou must delete the existing auto start before creating a new one. \
647 | Only one modem at a time can be set to auto start at boot." \
648 | --button="Delete Current":1 \
649 | --button="Keep Current":2
650 | BUT=$?
651 | if [ $BUT = 1 ]; then
652 | crontab -l > /run/user/$UID/tempcron.txt
653 | rm $CONF
654 | sed -i '/patmenu2\/start/d' /run/user/$UID/tempcron.txt
655 | crontab /run/user/$UID/tempcron.txt
656 | elif [ $BUT = 2 ]; then
657 | $MAIN &
658 | exit
659 | elif [ $BUT = 252 ]; then
660 | exit
661 | fi
662 | fi
663 |
664 | AUTO=$(yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
665 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
666 | --text="Auto Modem Start by KM4ACK" \
667 | --field="Auto Start Modem on Boot":CB "NONE|VARA|VARA-FM|ARDOP|Packet")
668 | BUT=$?
669 |
670 | AUTO=$(echo $AUTO | awk -F "|" '{print $1}')
671 |
672 | #give user chance to exit/cancel
673 | if [ $BUT = 252 ]; then
674 | exit
675 | elif [ $BUT = 1 ]; then
676 | $MAIN &
677 | exit
678 | fi
679 |
680 | #set command per user selection
681 | if [ "$AUTO" = 'VARA' ]; then
682 | echo "VARA Selected"
683 | AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-hf"
684 | elif [ "$AUTO" = 'VARA-FM' ]; then
685 | echo "VARA FM Selected"
686 | AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-vara-fm"
687 | elif [ "$AUTO" = 'ARDOP' ]; then
688 | echo "ARDOP Selected"
689 | AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat-ardop"
690 | elif [ "$AUTO" = 'Packet' ]; then
691 | echo "Packet Selected"
692 | AUTO_CMD="sleep 15 && export DISPLAY=:0 && $HOME/patmenu2/start-pat2m"
693 | elif [ "$AUTO" = 'NONE' ]; then
694 | $MAIN &
695 | exit
696 | fi
697 |
698 | #send the command to the conf file
699 | echo "AUTO_CMD=\"$AUTO_CMD\"" > $CONF
700 |
701 | #add auto start to current cron job
702 | crontab -l > /run/user/$UID/tempcron.txt
703 | echo "@reboot $AUTO_CMD" >> /run/user/$UID/tempcron.txt
704 | crontab /run/user/$UID/tempcron.txt
705 |
706 | #give user feedback
707 | yad --form --width=420 --text-align=center --center --title="Auto Modem Start" --text-align=center \
708 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
709 | --text="$AUTO will auto start at boot\r\rIMPORTANT NOTE!\rThe sound card MUST be plugged in \
710 | before booting the Pi or the auto start feature will FAIL." \
711 | --button=gtk-ok
712 | $MAIN &
713 | exit
714 | }
715 |
716 |
717 |
--------------------------------------------------------------------------------
/mobi-pair:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #this script attempts to pair a Mobilinkd TNC with the Pi.
4 | #04MARCH2022 KM4ACK
5 |
6 | EXISTING=`bluetoothctl paired-devices | grep Mobilinkd`
7 | TMP=/run/user/$UID/mobi.txt
8 |
9 | #see if we already have a TNC paired
10 | if [ -n "$EXISTING" ]; then
11 | clear;echo;echo
12 | cat </dev/null; then
21 | echo "We are missing a dependency....expect"
22 | echo "Hang on while it is installed"
23 | echo "You can press ctrl+c to exit"
24 | sleep 3
25 | sudo apt update
26 | sudo apt install -y expect
27 | fi
28 |
29 | #create connect script in RAM memory. (Called later from this script)
30 | cat << "MYFILE" > /run/user/$UID/connect
31 | #!/usr/bin/expect -f
32 |
33 | set prompt "#"
34 | set address [lindex $argv 0]
35 |
36 | spawn sudo bluetoothctl
37 | expect -re $prompt
38 | send "scan on\r"
39 | send_user "\nStandby\r"
40 | sleep 10
41 | send_user "\nStill working\r"
42 | send "scan off\r"
43 | expect "Controller"
44 | send "pair $address\r"
45 | sleep 5
46 | send "1234\r"
47 | sleep 3
48 | send_user "\nShould be paired now.\r"
49 | send "quit\r"
50 | expect eof
51 | MYFILE
52 | chmod +x /run/user/$UID/connect
53 |
54 | #give user some feedback
55 | echo;echo; clear
56 | cat < $TMP
66 | echo "Discovery complete. TNC found.";echo
67 | MAC=`grep -i TNC /run/user/$UID/mobi.txt | awk '{print $1}'`
68 | #verify we have a MAC address to work with
69 | if [ -z "$MAC" ]; then
70 | echo "TNC not found. Can't continue!"
71 | echo "Confirm that the TNC is on and has"
72 | echo "a fast flashing blue light."
73 | sleep 5
74 | exit 1
75 | fi
76 | echo "Starting the pairing process....please stand by"
77 | #call the connect script
78 | /run/user/$UID/connect $MAC >/dev/null 2>&1
79 | echo;echo "The pairing was probably successful"
80 | echo "Start the Mobilinkd modem again"
81 | sleep 3
82 |
--------------------------------------------------------------------------------
/mobi-wired:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #This script will connect Mobilinkd TNC3 through a USB connection
4 | #and make the TNC available with Pat through an ax25 connection.
5 | #This script will NOT work with the Mobilinkd TNC2 as it did not
6 | #support a USB connection.
7 | #07MARCH2022 KM4ACK
8 |
9 | MYPATH=$HOME/patmenu2
10 | LOGO=$MYPATH/pmlogo.png
11 | KISS=$(pidof kissattach)
12 | DIRE=$(pidof direwolf)
13 | ARDOP=$(pidof piardopc)
14 | MOBIUSB=$(ls -l /dev/serial/by-id | grep Mobilinkd | awk '{print $NF}' | sed 's/.*tty/tty/')
15 |
16 | #verify mobilinkd is plugged in and detected
17 | if [ -z "$MOBIUSB" ]; then
18 | yad --title="Not Detected" --width=400 --height=100 \
19 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
20 | --center --form --text="\r\r\r\rThe Mobilinkd TNC wasn't detected. Please \
21 | connect the Mobilinkd TNC to the Pi with a USB cable." \
22 | --button=gtk-ok
23 | exit 1
24 | fi
25 |
26 | #verify other services that might interfere aren't running
27 | if [ -n "$KISS" ] || [ -n "$DIRE" ] || [ -n "$ARDOP" ]; then
28 | yad --title="Stop Modems" --width=400 --height=100 \
29 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
30 | --center --form --text="\r\r\r\rIt appears that other modems are running. Please \
31 | stop all modems and try again." \
32 | --button=gtk-ok
33 | exit 1
34 | fi
35 |
36 |
37 | #create kissattach needed for winlink connections
38 | sudo kissattach /dev/$MOBIUSB wl2k &
39 | sleep 3
40 | sudo kissparms -c 1 -p wl2k
41 |
42 | #verify that kissattach is running
43 | PIDPIC=$(pidof kissattach)
44 | if [ -z "$PIDPIC" ]
45 | then
46 | yad --title="FAILED" --width=400 --height=100 \
47 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
48 | --center --form --text="The Mobilinkd Modem FAILED to Start" \
49 | --button=gtk-ok
50 | else
51 | yad --title="Mobilinkd MODEM" --width=400 --height=100 \
52 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
53 | --center --form --text="\r\r\r\rThe Mobilinkd Modem has Started" \
54 | --button=gtk-ok &
55 | fi
56 |
57 | #restart pat so terminal window correctly reflects rig control
58 | sudo systemctl restart pat@`whoami`
59 |
60 | source $HOME/patmenu2/config
61 |
62 | #open pat inbox in browser
63 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 &
--------------------------------------------------------------------------------
/mobilink:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to connect mobilinkd TNC for ax25
4 | #20200602
5 | #20230304 last edit KM4ACK
6 | ################################################################
7 | # #
8 | # # # # # # # ##### # # #
9 | # # # # # # # ## # # # # # #
10 | # # # # # # # # # # # # # #
11 | # ## # # ##### ####### # ## #
12 | # # # # # # # # # # # #
13 | # # # # # # # # # # # #
14 | # # # # # # # # ##### # # #
15 | # #
16 | ################################################################
17 |
18 | #special thanks to Rich for loaning me a TNC3 to test with
19 | MYPATH=$HOME/patmenu2
20 | LOGO=$MYPATH/pmlogo.png
21 | clear
22 | KISS=$(pidof kissattach)
23 | DIRE=$(pidof direwolf)
24 | ARDOP=$(pidof piardopc)
25 | TMPFILE=/run/user/$UID/scan.txt
26 | EXISTING=`bluetoothctl paired-devices | grep Mobilinkd`
27 |
28 | #see if we already have a TNC paired
29 | #if [ -z "$EXISTING" ]; then
30 | #yad --title="Mobilinkd Error" --width=400 --height=100 \
31 | #--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
32 | #--center --form --text="\r\r\r\rNo Mobilinkd devices paired with this pi. \
33 | #To pair, turn your Mobilinkd on, open a terminal window, and run\r ~/patmenu2/mobi-pair\rand then start \
34 | #the mobilinkd modem again." \
35 | #--button=gtk-ok
36 | #exit 1
37 | #fi
38 |
39 | #see if we already have a TNC paired
40 | if [ -z "$EXISTING" ]; then
41 | yad --title="Mobilinkd Error" --width=400 --height=100 \
42 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
43 | --center --form --text="\r\r\r\rNo Mobilinkd devices paired with this pi. \
44 | Turn on your Mobilinkd before attempting to pair." \
45 | --button="Pair Now:1" \
46 | --button="Exit:2"
47 | BUT=$?
48 |
49 | if [ "$BUT" = '2' ] || [ "$BUT" = '252' ]; then
50 | exit
51 | elif [ "$BUT" = '1' ]; then
52 | lxterminal -e $HOME/patmenu2/mobi-pair
53 | exit
54 | fi
55 |
56 | fi
57 |
58 |
59 | #verify other services that might interfere aren't running
60 | if [ -n "$KISS" ] || [ -n "$DIRE" ] || [ -n "$ARDOP" ]; then
61 | yad --title="Stop Modems" --width=400 --height=100 \
62 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
63 | --center --form --text="\r\r\r\rIt appears that other modems are running. Please \
64 | stop all modems and try again." \
65 | --button=gtk-ok
66 | exit 1
67 | fi
68 |
69 | #give user some feedback
70 | yad --center --timeout=10 --timeout-indicator=top --no-buttons --height=300 --width=300 \
71 | --title="Scanning" --image $LOGO --window-icon=$LOGO --image-on-top \
72 | --text="Scanning for device. This takes about 20 seconds to complete. \
73 | Another notice will appear once a connection to the device is established." &
74 |
75 | #scan for bluetooth device and write to file
76 | hcitool scan > $TMPFILE
77 |
78 | #Decide if its a TNC 2 or 3
79 | TNC2=$(grep -i TNC2 $TMPFILE)
80 | TNC3=$(grep -i TNC3 $TMPFILE)
81 | TNC4=$(grep -i TNC4 $TMPFILE)
82 | if [ -n "$TNC2" ]; then
83 | MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
84 | TNC=2
85 | elif [ -n "$TNC3" ]; then
86 | MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
87 | TNC=3
88 | elif [ -n "$TNC4" ]; then
89 | MAC=$(grep -i mobi $TMPFILE | awk '{ print $1 }')
90 | TNC=4
91 | fi
92 |
93 | #set correct connection commmand
94 | if [ $TNC = "2" ]; then
95 | CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
96 | elif [ $TNC = "3" ]; then
97 | CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC 6"
98 | elif [ $TNC = "4" ]; then
99 | CONNECT="sudo rfcomm bind /dev/rfcomm0 $MAC"
100 | fi
101 |
102 | #See if device was found and connect if found
103 | if [ -z "$MAC" ]
104 | then
105 | yad --title="Mobilinkd MODEM" --width=400 --height=100 \
106 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
107 | --center --form --text="\r\r\r\rMobilinkd NOT FOUND" \
108 | --button=gtk-ok
109 | rm $TMPFILE
110 | exit 1
111 | else
112 | #stop things that might conflict
113 | sudo killall kissattach direwolf >> /dev/null 2>&1
114 | yad --center --timeout=6 --timeout-indicator=top --no-buttons --height=300 --width=300 \
115 | --title="Detected" --image $LOGO --window-icon=$LOGO --image-on-top \
116 | --text="Mobilinkd TNC $TNC detected. Just a few more seconds." &
117 | rm $TMPFILE
118 | #create bluetooth->serial connection
119 | $CONNECT &
120 | sleep 5
121 |
122 |
123 | #create kissattach needed for winlink connections
124 | sudo kissattach /dev/rfcomm0 wl2k &
125 | sleep 3
126 | sudo kissparms -c 1 -p wl2k
127 | fi
128 |
129 | #verify that kissattach is running
130 | PIDPIC=$(pidof kissattach)
131 | if [ -z "$PIDPIC" ]
132 | then
133 | yad --title="FAILED" --width=400 --height=100 \
134 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
135 | --center --form --text="The Mobilinkd Modem FAILED to Start" \
136 | --button=gtk-ok
137 | else
138 | yad --title="Mobilinkd MODEM" --width=400 --height=100 \
139 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
140 | --center --form --text="\r\r\r\rThe Mobilinkd Modem has Started" \
141 | --button=gtk-ok &
142 | fi
143 |
144 | #restart pat so terminal window correctly reflects rig control
145 | sudo systemctl restart pat@`whoami`
146 |
147 | source $HOME/patmenu2/config
148 |
149 | #open pat inbox in browser
150 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 &
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/modems:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #Pat Modems
4 | #20220309 KM4ACK
5 |
6 |
7 |
8 | export MYPATH=$HOME/patmenu2
9 | LOGO=$MYPATH/pmlogo.png
10 | MAIN=$MYPATH/./patmenu
11 | VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//')
12 |
13 | source $MYPATH/config
14 |
15 |
16 |
17 | yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
18 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
19 | --text="Pat Menu by KM4ACK\rv$VERSION" \
20 | --field="Start ARDOP Modem":fbtn 'bash -c "$MYPATH/start-pat-ardop"' \
21 | --field="Start Packet Modem":fbtn 'bash -c "$MYPATH/start-pat2m"' \
22 | --field="Start Mobilinkd Modem Bluetooth":fbtn 'bash -c "$MYPATH/mobilink"' \
23 | --field="Start Mobilinkd Modem Wired":fbtn 'bash -c "$MYPATH/mobi-wired"' \
24 | --field="Start VARA Modem (BETA)":fbtn 'bash -c "$MYPATH/start-vara-hf"' \
25 | --field="Start VARA FM Modem (BETA)":fbtn 'bash -c "$MYPATH/start-vara-fm"' \
26 | --field="Stop Modems":fbtn 'bash -c "$MYPATH/stop-modems"' \
27 | --button="Main Menu":1
28 | BUT=$?
29 |
30 | if [ $BUT = 1 ]; then
31 | $MAIN &
32 | exit
33 | fi
--------------------------------------------------------------------------------
/pat-functions:
--------------------------------------------------------------------------------
1 |
2 |
3 | MYPATH=$HOME/patmenu2
4 | LOGO=$MYPATH/pmlogo.png
5 | MAIN=$MYPATH/./patmenu
6 | PATCONFIG=$XDG_CONFIG_HOME/pat/config.json
7 |
8 | AUTOPAT(){
9 | source $MYPATH/config
10 | if [ $RIGCONTROL == 'no' ]
11 | then
12 |
13 | yad --title="NO RIG CONTROL" --width=400 --height=100 \
14 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
15 | --center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again. \
16 | \rRig control can be configured using\rManage Pat Menu"
17 | --button=gtk-ok
18 | $MAIN &
19 | exit
20 | fi
21 |
22 |
23 | MIN="50|100|150|200|250|300|350|400|450|500|550|600|650|700|750|800|850|900|950|1000"
24 | MAX="500|550|600|650|700|750|800|850|900|950|1000|1500|2000|2500|3000"
25 | INFO=$(yad --form --width=420 --text-align=center --center --title="Pat Auto" --text-align=center \
26 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
27 | --text="Pat Auto Connect by KM4ACK" \
28 | --field="Modem":CB "VARA|ARDOP" \
29 | --field="Band":CB "20|30|40|80" \
30 | --field="Minimum Distance":CBE "$MIN" \
31 | --field="Maximum Distance":CBE "$MAX" \
32 | --button="Start Connection":2 \
33 | --button="Cancel":1)
34 | BUT=$?
35 | if [ "$BUT" = 1 ]; then
36 | $MAIN
37 | exit
38 | fi
39 |
40 | MODEM=$(echo $INFO | awk -F "|" '{print $1}')
41 | BAND=$(echo $INFO | awk -F "|" '{print $2}')
42 | MIN=$(echo $INFO | awk -F "|" '{print $3}')
43 | MAX=$(echo $INFO | awk -F "|" '{print $4}')
44 |
45 | #echo "Modem = $MODEM"
46 | #echo "Band = $BAND"
47 | #echo "MIN = $MIN"
48 | #echo "MAX = $MAX"
49 |
50 | if [ -z "$MIN" ]; then
51 | MIN=0
52 | fi
53 |
54 | if [ -z "$MAX" ]; then
55 | MAX=0
56 | fi
57 |
58 |
59 | if [ "$MIN" -gt "$MAX" ]; then
60 | yad --form --width=420 --text-align=center --center --title="Pat Auto" --text-align=center \
61 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
62 | --text="Pat Auto Connect by KM4ACK \r\rMinimum distance can't be greater\rthan maximum distance.\rTry again" \
63 | --button=gtk-ok
64 | AUTOPAT
65 | fi
66 |
67 | #set correct comamnd for modem
68 | if [ "$MODEM" = 'ARDOP' ]; then
69 | lxterminal -e $MYPATH/autopat $MAX $BAND $MIN
70 | elif [ "$MODEM" = 'VARA' ]; then
71 | lxterminal -e $MYPATH/autopat-vara $MAX $BAND $MIN
72 | fi
73 |
74 | $MAIN
75 | }
76 |
77 |
78 | SETTINGS(){
79 | source $MYPATH/config
80 | CONFIGTMP=$MYPATH/config.temp
81 | CONFIG=$MYPATH/config
82 |
83 | SETTINGS=$(yad --form --width=600 --text-align=center --center --title="Pat Menu Settings" --text-align=center \
84 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
85 | --text="Pat Menu Settings by KM4ACK" \
86 | --field="Call Sign" "$MYCALLSIGN" \
87 | --field="MAP":CB "usa|world" \
88 | --field="Rig Control":CB "no|yes" \
89 | --field="ARDOP Command" "$ARDOP" \
90 | --field="ARDOP GUI Command" "$ARDOPGUI" \
91 | --field="Direwolf Command" "$DIREWOLF" \
92 | --field="KISS Command" "$KISS" \
93 | --field="AX25 Port" "$AXP" \
94 | --field="Rig Control Command" "$RIG" \
95 | --field="HF Mode for Radio" "$MODEHF" \
96 | --field="2M Mode for Radio" "$MODE2M" \
97 | --field="Pat Port" "$PORT" \
98 | --field="Log File Location" "$LOG" \
99 | --field="AmRRON":CB "no|yes" \
100 | --button="Update":2 \
101 | --button="Cancel":1)
102 | BUT=$?
103 | if [ $BUT = 1 ]; then
104 | $MAIN
105 | elif [ $BUT = 252 ]; then
106 | exit
107 | elif [ $BUT = 2 ]; then
108 | MYCALLSIGN=$(echo $SETTINGS | awk -F "|" '{print $1}')
109 | MAP=$(echo $SETTINGS | awk -F "|" '{print $2}')
110 | RIGCONTROL=$(echo $SETTINGS | awk -F "|" '{print $3}')
111 | ARDOP=$(echo $SETTINGS | awk -F "|" '{print $4}')
112 | ARDOPGUI=$(echo $SETTINGS | awk -F "|" '{print $5}')
113 | DIREWOLF=$(echo $SETTINGS | awk -F "|" '{print $6}')
114 | KISS=$(echo $SETTINGS | awk -F "|" '{print $7}')
115 | AXP=$(echo $SETTINGS | awk -F "|" '{print $8}')
116 | RIG=$(echo $SETTINGS | awk -F "|" '{print $9}')
117 | MODEHF=$(echo $SETTINGS | awk -F "|" '{print $10}')
118 | MODE2M=$(echo $SETTINGS | awk -F "|" '{print $11}')
119 | PORT=$(echo $SETTINGS | awk -F "|" '{print $12}')
120 | LOG=$(echo $SETTINGS | awk -F "|" '{print $13}')
121 | AMRRON=$(echo $SETTINGS | awk -F "|" '{print $14}')
122 |
123 | echo "#Config file for Pat Menu" > $CONFIGTMP
124 | echo "#20200429 KM4ACK" >> $CONFIGTMP
125 | echo "MYCALLSIGN=$MYCALLSIGN" >> $CONFIGTMP
126 | echo "MAP=$MAP" >> $CONFIGTMP
127 | echo "RIGCONTROL=$RIGCONTROL" >> $CONFIGTMP
128 | echo "ARDOP=\"$ARDOP\"" >> $CONFIGTMP
129 | echo "ARDOPGUI=\"$ARDOPGUI\"" >> $CONFIGTMP
130 | echo "DIREWOLF=\"$DIREWOLF\"" >> $CONFIGTMP
131 | echo "KISS=\"$KISS\"" >> $CONFIGTMP
132 | echo "AXP=$AXP" >> $CONFIGTMP
133 | echo "RIG=\"$RIG\"" >> $CONFIGTMP
134 | echo "MODEHF=$MODEHF" >> $CONFIGTMP
135 | echo "MODE2M=$MODE2M" >> $CONFIGTMP
136 | echo "PORT=$PORT" >> $CONFIGTMP
137 | echo "LOG=$LOG" >> $CONFIGTMP
138 | echo "AMRRON=$AMRRON" >> $CONFIGTMP
139 | cp $CONFIGTMP $CONFIG
140 | rm $CONFIGTMP
141 | $MAIN &
142 | exit
143 | fi
144 | }
145 |
146 | STATS(){
147 | CONFIG=$PATCONFIG
148 | SMD=/lib/systemd/system/pat@.service
149 | CALL=$(grep mycall $CONFIG | head -1 | sed s'/"mycall": //;s/"//g;s/,//;s/ //g')
150 | GRID=$(grep locator $CONFIG | sed 's/"//g;s/locator://;s/,//;s/ //g')
151 | ARDOPMAX=$(grep -i max $CONFIG | sed 's/"Max":\ //;s/ //g')
152 | PTT=$(grep ptt_ctrl $CONFIG | tail -1 | sed 's/"ptt_ctrl":\ //;s/,//;s/ //g')
153 | PORT=$(grep http_addr $CONFIG | awk '{print $2}' | sed 's/.*://;s/",//')
154 | RIG=$(grep RIGCONTROL $HOME/patmenu2/config | sed 's/RIGCONTROL=//')
155 | TELNET=$(grep telnet, $SMD)
156 | ARDOP=$(grep ardop, $SMD)
157 | AX25=$(grep ax25, $SMD)
158 | PAT=$(pidof pat)
159 | CARD=$(arecord -l | grep USB | awk '{print $2;}' | sed 's/://')
160 |
161 | #Check if sound card found
162 | if [ -z $CARD ]; then
163 | CARD="Not found"
164 | else
165 | CARD="$CARD,0"
166 | fi
167 | #Set telnet variable
168 | if [ -n "$TELNET" ]; then
169 | TELNET="telnet,"
170 | fi
171 | #set ardop variable
172 | if [ -n "$ARDOP" ]; then
173 | ARDOP="ardop,"
174 | fi
175 | #set ax25 variable
176 | if [ -n "$AX25" ]; then
177 | AX25="ax25,"
178 | fi
179 | if [ -z "$TELNET" ] && [ -z "$ARDOP" ] && [ -z "$AX25" ]; then
180 | LISTEN="Not Listening"
181 | else
182 | LISTEN="$TELNET$ARDOP$AX25"
183 | fi
184 |
185 | #set Pat Variable
186 | if [ -z $PAT ]; then
187 | PAT="Not Running"
188 | else
189 | PAT="Running"
190 | fi
191 |
192 | yad --form --width=320 --text-align=center --center --title="Quick Stats" --text-align=center \
193 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
194 | --text="Quick Stats" \
195 | --field="Current User":RO "$CALL" \
196 | --field="Current Grid":RO "$GRID" \
197 | --field="ARDOP Speed":RO "$ARDOPMAX" \
198 | --field="ARDOP PTT is":RO "$PTT" \
199 | --field="Listen Modes":RO "$LISTEN" \
200 | --field="Rig Control":RO "$RIG" \
201 | --field="Pat Port":RO "$PORT" \
202 | --field="Pat Server":RO "$PAT" \
203 | --field="Sound Card":RO "$CARD" \
204 | --button=gtk-ok
205 | $MAIN &
206 | exit
207 | }
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/patmenu:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #Pat Menu
4 | #20200427 KM4ACK
5 | #side note: written during covid-19 outbreak of 2020
6 |
7 |
8 | export MYPATH=$HOME/patmenu2
9 | LOGO=$MYPATH/pmlogo.png
10 | MAIN=$MYPATH/./patmenu
11 | VERSION=$(cat $MYPATH/changelog | grep release | head -1 | sed 's/release=//')
12 |
13 | source $MYPATH/config
14 |
15 | #verify pat is at least v0.12.0
16 | PAT_VER=`pat version | awk '{print $2}' | awk -F "." '{print $2}'`
17 |
18 | if [ $PAT_VER -lt 12 ]; then
19 | #give user notice
20 | yad --form --width=420 --text-align=center --center --title="Pat out of Date" --text-align=center \
21 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
22 | --text="Pat Menu only supports Pat Winlink\rversion 0.12.0 or later\rPlease update Pat Winlink" \
23 | --button=gtk-ok
24 | exit
25 | fi
26 |
27 | if [ $WARN = 'yes' ] && [ ! -f /run/user/$UID/patwarn.txt ]; then
28 | #give user warning message
29 | yad --form --width=420 --text-align=center --center --title="WARNING!!" --text-align=center \
30 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
31 | --text="${WARNMSG}" \
32 | --button=gtk-ok
33 | touch /run/user/$UID/patwarn.txt
34 | fi
35 |
36 | #verify call is set
37 | if [ "$MYCALLSIGN" = "N0CALL" ]; then
38 | yad --title="N0CALL" --width=400 --height=100 \
39 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
40 | --center --form --text="\r\r\r\rCall sign not set! \rGo to Settings, then Current Config Settings\rand update your call sign" \
41 | --button=gtk-ok
42 | fi
43 |
44 | #get name of current config file
45 | source $MYPATH/.currentconf
46 | CONFIG=$(echo $CONF | sed 's/.config//')
47 | CURRENT_GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator": "//;s/ //g;s/",//')
48 | if [ -z $CONFIG ]; then
49 | CONFIG=default
50 | fi
51 |
52 | yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-align=center \
53 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
54 | --text="Pat Menu by KM4ACK\rv$VERSION" \
55 | --field="Start/Stop Modem":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/modems"' \
56 | --field="Find Winlink Gateways":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/find2"' \
57 | --field="Pat Auto Connect":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; AUTOPAT"' \
58 | --field="Pat Catalog":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/catalog"' \
59 | --field="Manage Inbox":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-inbox"' \
60 | --field="Manage Pat Winlink":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-pat"' \
61 | --field="Manage Winlink Forms":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-forms"' \
62 | --field="Settings/Config":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-menu"' \
63 | --field="Quick Stats":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; STATS"' \
64 | --field="My Call - $MYCALLSIGN":LBL \
65 | --field="Config - $CONFIG":LBL \
66 | --field="Grid - $CURRENT_GRID":LBL \
67 | --button="QUIT":1
68 |
69 | BUT=$?
70 | if [ $BUT = 1 ]; then
71 | exit
72 | fi
73 |
--------------------------------------------------------------------------------
/patmenu2.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Pat Menu
3 | GenericName=Amateur Radio Digital Modem
4 | Comment=Amateur Radio Sound Card Communications
5 | Exec=/home/pi/patmenu2/patmenu
6 | Icon=/home/pi/patmenu2/pmlogo.png
7 | Terminal=false
8 | Type=Application
9 | Categories=Network;HamRadio;
10 |
--------------------------------------------------------------------------------
/pmlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/km4ack/patmenu2/e5ef6416c6a9619c1be06cbe0fc78aadbb55bcbf/pmlogo.png
--------------------------------------------------------------------------------
/setup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #install script patmenu2
4 | #20200511 km4ack
5 |
6 |
7 | MYPATH=$HOME/patmenu2
8 | BKDIR=$HOME/Desktop/config-bkups
9 | NEWCONFIG=$HOME/Desktop/test.txt
10 |
11 | #get depends if needed.
12 | sudo apt-get update
13 | if ! hash yad 2>/dev/null; then
14 | sudo apt install -y yad
15 | fi
16 | if ! hash jq 2>/dev/null; then
17 | sudo apt install -y jq
18 | fi
19 |
20 | if [ -f $HOME/patmenu/config ]; then
21 | #get patmenu config file and copy to patmenu2
22 | cp $HOME/patmenu/config $HOME/patmenu2/config
23 |
24 | #create backup folder and copy any user config files from patmenu1
25 | mkdir -p $BKDIR
26 | cp $HOME/patmenu/*config* $BKDIR
27 | #remove restore script that gets copied with above command
28 | rm $BKDIR/restore-config
29 |
30 | #remove old patmenu
31 | rm -rf $HOME/patmenu
32 |
33 | #remove old shortcut if exist
34 | if [ -L $HOME/Desktop/Pat-Menu ]; then
35 | rm $HOME/Desktop/Pat-Menu
36 | fi
37 |
38 | fi
39 |
40 |
41 | #create new desktop link
42 | cat < /run/user/$UID/patmenu.desktop
43 | [Desktop Entry]
44 | Name=Pat Menu
45 | GenericName=Amateur Radio Digital Modem
46 | Comment=Amateur Radio Sound Card Communications
47 | Exec=/home/`whoami`/patmenu2/patmenu
48 | Icon=/home/`whoami`/patmenu2/pmlogo.png
49 | Terminal=false
50 | Type=Application
51 | Categories=Network;HamRadio;
52 | EOF
53 | sudo cp /run/user/$UID/patmenu.desktop /usr/share/applications/patmenu.desktop
54 |
55 | #download RMS List
56 | $MYPATH/getardoplist
57 |
58 | #remove this script
59 | rm $MYPATH/setup
60 |
61 |
--------------------------------------------------------------------------------
/sms/add-carrier:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to add phone carries to master list
4 | #KM4ACK 02AUGUST2022
5 |
6 | FILE=$HOME/patmenu2/sms/cellproviders.txt
7 | MYTEMP=/run/user/$UID/templist.txt
8 | MAIN=$HOME/patmenu2/sms/manage-sms
9 | export MYPATH=$HOME/patmenu2
10 | LOGO=$MYPATH/pmlogo.png
11 |
12 | INFO=$(PARSER='OFS="\n" {print $1}'
13 |
14 | tail -300 $FILE | awk "$PARSER" | \
15 | yad --title="Search Results" --width=1100 --height=500 \
16 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
17 | --center --list --text="Carrier List" \
18 | --column Carrier \
19 | --button="Cancel":1 \
20 | --button="Add Carrier":2 > $MYTEMP)
21 | BUT=$?
22 |
23 | if [ $BUT = 1 ]; then
24 | $MAIN &
25 | exit
26 | elif [ $BUT = 252 ]; then
27 | exit
28 | fi
29 |
30 | sed -i 's/|//g' $MYTEMP
31 |
32 | cat $MYTEMP >> $HOME/patmenu2/sms/myphonelist.txt
33 | sort $HOME/patmenu2/sms/myphonelist.txt > /run/user/$UID/sortedlist
34 | mv /run/user/$UID/sortedlist $HOME/patmenu2/sms/myphonelist.txt
35 |
36 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="The carrier list has been updated"
37 |
38 | $MAIN &
39 | exit
--------------------------------------------------------------------------------
/sms/cellproviders.txt:
--------------------------------------------------------------------------------
1 | 3-River-Wireless=@sms.3rivers.net
2 | ACS-Wireless=@paging.acswireless.com
3 | Alltel=@message.alltel.com
4 | ATT=@txt.att.net
5 | Bell-Canada=@txt.bellmobility.ca
6 | Bell-Canada=@bellmobility.ca
7 | Bell-Mobility=@txt.bell.ca
8 | Bell-Mobility=@txt.bellmobility.ca
9 | Blue-Sky-Frog=@blueskyfrog.com
10 | Bluegrass-Cellular=@sms.bluecell.com
11 | Boost-Mobile=@myboostmobile.com
12 | BPL-Mobile=@bplmobile.com
13 | Carolina-West=@cwwsms.com
14 | Cellular-One=@mobile.celloneusa.com
15 | Cellular-South=@csouth1.com
16 | Centennial-Wireless=@cwemail.com
17 | CenturyTel=@messaging.centurytel.net
18 | Cingular=@txt.att.net
19 | Clearnet=@msg.clearnet.com
20 | Comcast=@comcastpcs.textmsg.com
21 | Corr-Wireless=@corrwireless.net
22 | Dobson=@mobile.dobson.net
23 | Edge-Wireless=@sms.edgewireless.com
24 | Fido=@fido.ca
25 | Golden-Telecom=@sms.goldentele.com
26 | Helio=@messaging.sprintpcs.com
27 | Houston-Cellular=@text.houstoncellular.net
28 | Idea-Cellular=@ideacellular.net
29 | Illinois-Valley-Cellular=@ivctext.com
30 | Inland-Cellular=@inlandlink.com
31 | MCI=@pagemci.com
32 | Metroncall=@page.metrocall.com
33 | Metrocall-2-Way=@my2way.com
34 | Metro-PCS=@mymetropcs.com
35 | Microcell=@fido.ca
36 | Midwest-Wireless=@clearlydigital.com
37 | Mobilcomm=@mobilecomm.net
38 | MTS=@text.mtsmobility.com
39 | Nextel=@messaging.nextel.com
40 | OnlineBeep=@onlinebeep.net
41 | PCS-One=@pcsone.net
42 | Presidents-Choice=@txt.bell.ca
43 | Public-Service-Cellular=@sms.pscel.com
44 | Quest=@qwestmp.com
45 | 10digitphonenumber=@pcs.rogers.com
46 | Rogers-Canada=@pcs.rogers.com
47 | Satellink=.pageme@satellink.net
48 | Southwestern-Bell=@email.swbw.com
49 | Sprint=@messaging.sprintpcs.com
50 | Sumcom=@tms.suncom.com
51 | Surewest-Comms=@mobile.surewest.com
52 | T-Mobile=@tmomail.net
53 | Telus=@msg.telus.com
54 | Tracfone=@txt.att.net
55 | Triton=@tms.suncom.com
56 | Unicel=@utext.com
57 | US-Cellular=@email.uscc.net
58 | Solo-Mobile=@txt.bell.ca
59 | Sprint=@messaging.sprintpcs.com
60 | Sumcom=@tms.suncom.com
61 | Surewest=@mobile.surewest.com
62 | T-Mobile=@tmomail.net
63 | Telus=@msg.telus.com
64 | Triton=@tms.suncom.com
65 | Unicel=@utext.com
66 | US-Cellular=@email.uscc.net
67 | US-West=@uswestdatamail.com
68 | Verizon=@vtext.com
69 | Virgin-Mobile=@vmobl.com
70 | Virgin-Mobile-Canada=@vmobile.ca
71 | West-Central=@sms.wcc.net
72 | Western-Wireless=@cellularonewest.com
73 |
--------------------------------------------------------------------------------
/sms/current-carriers:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to add phone carries to master list
4 | #KM4ACK 02AUGUST2022
5 |
6 | FILE=$HOME/patmenu2/sms/myphonelist.txt
7 | MYTEMP=/run/user/$UID/templist.txt
8 | MAIN=$HOME/patmenu2/sms/manage-sms
9 | export MYPATH=$HOME/patmenu2
10 | LOGO=$MYPATH/pmlogo.png
11 |
12 | INFO=$(PARSER='OFS="\n" {print $1}'
13 |
14 | tail -300 $FILE | awk "$PARSER" | \
15 | yad --title="Search Results" --width=600 --height=500 \
16 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
17 | --center --list --text="Carrier List" \
18 | --column Carrier \
19 | --button=gtk-ok)
20 | BUT=$?
21 | if [ $BUT = 252 ]; then
22 | exit
23 | fi
24 |
25 | $MAIN
--------------------------------------------------------------------------------
/sms/manage-sms:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #Pat SMS Manager
4 | #20220720 KM4ACK
5 |
6 |
7 | export MYPATH=$HOME/patmenu2
8 | LOGO=$MYPATH/pmlogo.png
9 | MAIN=$MYPATH/./patmenu
10 |
11 |
12 | yad --form --width=420 --text-align=center --center --title="Pat SMS Manager" --text-align=center \
13 | --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
14 | --text="Pat SMS Manager by KM4ACK" \
15 | --field="Show Current Carrier List":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/sms/current-carriers"' \
16 | --field="Add Carriers":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/sms/add-carrier"' \
17 | --field="Remove Carriers":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/sms/remove-carrier"' \
18 | --field="Send Text Message":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/sms/winlink2sms"' \
19 | --button="Main Menu":1
20 |
21 | BUT=$?
22 |
23 | if [ $BUT = 1 ]; then
24 | $MAIN &
25 | exit
26 | elif [ $BUT = 252 ]; then
27 | exit
28 | fi
--------------------------------------------------------------------------------
/sms/myphonelist.txt:
--------------------------------------------------------------------------------
1 | ATT=@txt.att.net
2 | Sprint=@messaging.sprintpcs.com
3 | T-Mobile=@tmomail.net
4 | Verizon=@vtext.com
5 | Unknown=
6 |
--------------------------------------------------------------------------------
/sms/remove-carrier:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to remove phone carries to master list
4 | #KM4ACK 02AUGUST2022
5 |
6 | FILE=$HOME/patmenu2/sms/myphonelist.txt
7 | MYTEMP=/run/user/$UID/templist.txt
8 | MAIN=$HOME/patmenu2/sms/manage-sms
9 | export MYPATH=$HOME/patmenu2
10 | LOGO=$MYPATH/pmlogo.png
11 |
12 | INFO=$(PARSER='OFS="\n" {print $1}'
13 |
14 | tail -300 $FILE | awk "$PARSER" | \
15 | yad --title="Search Results" --width=600 --height=500 \
16 | --image $LOGO --window-icon=$LOGO --image-on-top --multiple \
17 | --center --list --text="Current Carrier List" \
18 | --column Carrier \
19 | --button="Cancel":1 \
20 | --button="Remove Carrier":2 > $MYTEMP)
21 | BUT=$?
22 |
23 | if [ $BUT = 1 ]; then
24 | $MAIN &
25 | exit
26 | elif [ $BUT = 252 ]; then
27 | exit
28 | fi
29 |
30 | sed -i 's/|//g' $MYTEMP
31 |
32 | while read -r line; do
33 | sed -i "/$line/d" $FILE
34 | done < $MYTEMP
35 |
36 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="The carrier list has been updated"
37 |
38 | $MAIN &
39 | exit
--------------------------------------------------------------------------------
/sms/winlink2sms:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #Script to send text message to regular cellphones via Winlink
4 | #20JULY2022 KM4ACK
5 |
6 | #subject CANNOT be blank
7 | SUBJECT="Winlink text msg"
8 | #PHONE_LIST=/run/user/$UID/my_phonelist.txt
9 | PHONE_LIST=$HOME/patmenu2/sms/myphonelist.txt
10 | MAIN=$HOME/patmenu2/sms/manage-sms
11 |
12 | UNKNOWN(){
13 | #send message to every carrier in the list
14 | while read line in ; do
15 | CARRIER=$(echo $line | awk -F "=" '{print $2}')
16 | if [ -n "$CARRIER" ]; then
17 | TO="-c $PHONE$CARRIER"
18 | echo $TO >> /run/user/$UID/$PHONE.txt
19 | fi
20 | done <$PHONE_LIST
21 |
22 | #remove the "-c" from the first address on the list
23 | sed -i '0,/-c /{s/-c //}' /run/user/$UID/$PHONE.txt
24 | TO=$(cat /run/user/$UID/$PHONE.txt)
25 | rm /run/user/$UID/$PHONE.txt
26 |
27 | #compose message and send to pat outbox
28 | echo "$MESSAGE" | pat compose $TO -s "$SUBJECT"
29 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Message posted to Pat outbox." &
30 | exit
31 | }
32 |
33 | #get list of carriers to populate dialog carrier box on main screen
34 | CARRIER=$(cat $PHONE_LIST | awk -F"=" '{print $1"|"}')
35 |
36 | #main menu
37 | SETTING=$(yad --center --width=500 --wrap --window-icon=$HOME/Pi-APRS/ISS.png \
38 | --title="Send Text Messages via Winlink" --text="Please complete the following:" \
39 | --form --separator="|" --item-separator="|" \
40 | --field="Phone Number" "$PHONE" \
41 | --field="Carrier":CB "${CARRIER[@]}" \
42 | --field="Message" "$MSG" \
43 | --button="Post Message" \
44 | --button="Cancel"
45 | )
46 | BUT=$?
47 |
48 | #check to see if user wants to exit
49 | if [ $BUT = 252 ]; then
50 | echo "goodbye"
51 | exit
52 | elif [ $BUT = 1 ]; then
53 | $MAIN &
54 | exit
55 | fi
56 |
57 | #check to see if carrier is unknown. If so, send to UNKNOWN function.
58 | CARRIER=$(echo $SETTING | awk -F"|" '{print $2}' | sed 's/ //')
59 | if [ "$CARRIER" = 'Unknown' ]; then
60 | PHONE=$(echo $SETTING | awk -F"|" '{print $1}')
61 | MESSAGE=$(echo $SETTING | awk -F"|" '{print $3}')
62 | UNKNOWN
63 | fi
64 |
65 |
66 | PHONE=$(echo $SETTING | awk -F"|" '{print $1}' | sed 's/ //g')
67 | CARRIER=$(echo $SETTING | awk -F"|" '{print $2}' | sed 's/ //g')
68 | CARRIER=$(cat $PHONE_LIST | grep "$CARRIER" | sed 's/.*=//')
69 | TO=$PHONE$CARRIER
70 | MESSAGE=$(echo $SETTING | awk -F"|" '{print $3}')
71 |
72 | if [ -z "$PHONE" ]; then
73 | yad --center --width=300 --wrap --window-icon=$HOME/Pi-APRS/ISS.png \
74 | --title="ERROR" --text="Phone Number Can't Be Blank!" \
75 | --button=gtk-ok
76 | $MAIN &
77 | exit
78 | fi
79 |
80 |
81 |
82 | echo "$MESSAGE" | pat compose "$TO" -s "$SUBJECT"
83 |
84 | yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="Message posted to Pat outbox."
85 | $MAIN &
86 | exit
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/start-pat-ardop:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #start ardop modem
4 |
5 | #20191118 km4ack
6 |
7 | source $HOME/patmenu2/config
8 | MYPATH=$HOME/patmenu2
9 | LOGO=$MYPATH/pmlogo.png
10 |
11 | #Check if FLRIG is running if user has it set in config file
12 | if [ "$RIGCONTROL" = 'yes' ]; then
13 | echo "rig control is on"
14 | FLRIG=$(echo $RIG | grep "\-m 4")
15 | if [ -z "$FLRIG" ]; then
16 | echo
17 | else
18 | FLRIG=$(pidof flrig)
19 | if [ -z "$FLRIG" ]; then
20 | yad --title="FAILED" --width=400 --height=100 \
21 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
22 | --center --form --text="Please start FLRIG and try again" \
23 | --button=gtk-ok
24 | exit
25 | fi
26 | fi
27 | fi
28 |
29 | #Check if modem is already running
30 | MODEMCHECK=$(pidof piardopc)
31 | if [ -z "$MODEMCHECK" ]; then
32 | echo
33 | else
34 | yad --title="FAILED" --width=400 --height=100 \
35 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
36 | --center --form --text="ARDOP Modem is already running" \
37 | --button=gtk-ok
38 | exit
39 | fi
40 |
41 |
42 | if [ $AMRRON = "no" ] > /dev/null 2>&1
43 | then
44 | #check if direwolf is running
45 | PIDDW=$(pidof direwolf)
46 | if [ -z "$PIDDW" ]
47 | then
48 | echo
49 | else
50 | yad --title="FAILED" --width=400 --height=100 \
51 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
52 | --center --form --text="It looks like the 2M/440 modem is running.\rStop all modems and try again" \
53 | --button=gtk-ok
54 | exit
55 | fi
56 |
57 | fi
58 |
59 | yad --width=350 --height=75 --title="Start Modem" --timeout=2 --timeout-indicator=top --no-buttons --center \
60 | --text="Modem Starting....standby" &
61 |
62 |
63 | SETRIG () {
64 |
65 | #Set USB Mode
66 | RIGUSB=$RIG" M $MODEHF 0"
67 |
68 | #check rig is in USB
69 | MODE=$($RIG m | grep $MODEHF)
70 |
71 | sleep 1
72 |
73 | MODECHECK() {
74 | #check rig is in correct mode
75 | MODE=$($RIG m | grep $MODEHF)
76 | }
77 |
78 | sleep 1
79 |
80 | if [ -z $MODE ]
81 | then
82 | $RIGUSB
83 | MODECHECK
84 | fi
85 |
86 | }
87 |
88 | #see if rig control is used
89 | if [ $RIGCONTROL == 'yes' ]
90 | then
91 | PIDCTL=$(pidof rigctld)
92 | WHO=$(whoami)
93 | if [ -z "$PIDCTL" ]
94 | then
95 | CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/')
96 | $CONTROL &
97 | sudo systemctl restart pat@$WHO
98 | fi
99 | SETRIG
100 | fi
101 |
102 | #Start ARDOP_GUI
103 | $ARDOPGUI /dev/null &
104 |
105 | #start modem
106 | lxterminal --geometry=55x10 -e $ARDOP /dev/null &
107 | sleep 2
108 |
109 |
110 | #verify that piardopc is running
111 | PIDPIC=$(pidof piardopc)
112 | if [ -z "$PIDPIC" ]
113 | then
114 | yad --title="FAILED" --width=400 --height=100 \
115 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
116 | --center --form --text="The ARDOP Modem FAILED to Start" \
117 | --button=gtk-ok
118 | else
119 | yad --title="ARDOP MODEM" --width=400 --height=100 \
120 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
121 | --center --form --text="\r\r\r\rThe ARDOP Modem has Started" \
122 | --button=gtk-ok &
123 | fi
124 |
125 | #restart pat so terminal window correctly reflects rig control
126 | sudo systemctl restart pat@`whoami`
127 |
128 | #open pat inbox in browser
129 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 &
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/start-pat2m:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to start Pat for 2m packet work
4 | #20191116 km4ack
5 |
6 | clear
7 |
8 |
9 | TEMP=$HOME/patmenu2/temp
10 | MYPATH=$HOME/patmenu2
11 | LOGO=$MYPATH/pmlogo.png
12 | source $MYPATH/config
13 |
14 | #Check if FLRIG is running if user has it set in config file
15 | if [ "$RIGCONTROL" = 'yes' ]; then
16 | echo "rig control is on"
17 | FLRIG=$(echo $RIG | grep "\-m 4")
18 | if [ -z "$FLRIG" ]; then
19 | echo
20 | else
21 | FLRIG=$(pidof flrig)
22 | if [ -z "$FLRIG" ]; then
23 | yad --title="FAILED" --width=400 --height=100 \
24 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
25 | --center --form --text="Please start FLRIG and try again" \
26 | --button=gtk-ok
27 | exit
28 | fi
29 | fi
30 | fi
31 |
32 | #Check if modem is already running
33 | MODEMCHECK=$(pidof direwolf)
34 | if [ -z "$MODEMCHECK" ]; then
35 | echo
36 | else
37 | yad --title="FAILED" --width=400 --height=100 \
38 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
39 | --center --form --text="Packet Modem is already running" \
40 | --button=gtk-ok
41 | exit
42 | fi
43 |
44 | if [ $AMRRON = "no" ] > /dev/null 2>&1
45 | then
46 |
47 | #check if piardopc is running
48 | PIDDW=$(pidof piardopc)
49 | if [ -z "$PIDDW" ]
50 | then
51 | echo
52 | else
53 | yad --title="FAILED" --width=400 --height=100 \
54 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
55 | --center --form --text="It looks like the ARDOP modem is running.\rStop all modems and try again" \
56 | --button=gtk-ok
57 | exit 0
58 | fi
59 |
60 | fi
61 |
62 | yad --width=350 --height=75 --title="Start Modem" --timeout=3 --timeout-indicator=top --no-buttons --center \
63 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Modem Starting....standby" &
64 |
65 | if [ $AMRRON = "no" ] > /dev/null 2>&1
66 | then
67 | sudo killall direwolf kissattach > /dev/null 2>&1
68 | fi
69 | sleep 1
70 |
71 | #Set Mode
72 | RIGFM=$RIG" M $MODE2M 0"
73 |
74 | #set the long date
75 | TODAY=$(date)
76 |
77 | #set path to my log
78 | MYLOG=$HOME/Documents/mylog.txt
79 |
80 | SETRIG () {
81 |
82 | #set radio frequency & mode
83 | $RIGFM
84 |
85 | sleep 1
86 |
87 | #check rig is in correct mode
88 | MODE=$($RIG m | grep $MODE2M)
89 |
90 | sleep 1
91 |
92 | MODECHECK() {
93 | #check rig is in correct mode
94 | MODE=$($RIG m | grep $MODE2M)
95 | }
96 |
97 | sleep 1
98 |
99 | if [ -z $MODE ]
100 | then
101 | $RIGFM
102 | MODECHECK
103 | fi
104 | }
105 |
106 |
107 | #see if rig control is used
108 | if [ $RIGCONTROL == 'yes' ]
109 | then
110 | PIDCTL=$(pidof rigctld)
111 | WHO=$(whoami)
112 | if [ -z "$PIDCTL" ]
113 | then
114 | CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/')
115 | $CONTROL &
116 | sudo systemctl restart pat@$WHO
117 | fi
118 | SETRIG
119 | fi
120 |
121 | #added to resolve issue 24. km4ack 20200307
122 | /usr/local/bin/$DIREWOLF /dev/null &
123 | echo "Almost Done"
124 | sleep 5 | yad --width=350 --height=75 --auto-close --title="Direwolf" --progress --pulsate --no-buttons --center \
125 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Starting Direwolf....standby"
126 | #find what pt direwolf created (/dev/pts/X)
127 | LINK=$(ls -l /tmp/kisstnc | awk '{print $NF}')
128 | #end edit. km4ack 20200307
129 |
130 | sudo /usr/sbin/kissattach $LINK $AXP
131 | sudo kissparms -c 1 -p wl2k
132 | echo;echo;echo
133 |
134 | #verify direwolf has started
135 | PIDDW=$(pidof direwolf)
136 | if [ -z "$PIDDW" ]
137 | then
138 | yad --title="FAILED" --width=400 --height=100 \
139 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
140 | --center --form --text="The PACKET Modem FAILED to Start" \
141 | --button=gtk-ok
142 |
143 | else
144 |
145 | yad --title="PACKET MODEM" --width=400 --height=100 \
146 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
147 | --center --form --text="\r\r\r\rThe PACKET Modem has Started" \
148 | --button=gtk-ok &
149 | fi
150 |
151 | #restart pat so terminal window correctly reflects rig control
152 | sudo systemctl restart pat@`whoami`
153 |
154 | #open pat inbox in browser
155 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1 &
156 |
157 | #exit 0
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
--------------------------------------------------------------------------------
/start-vara-fm:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to start vara fm modem
4 | #10MARCH2022 KM4ACK
5 |
6 | MYPATH=$HOME/patmenu2
7 | LOGO=$MYPATH/pmlogo.png
8 | source $MYPATH/config
9 |
10 | if [ ! -f $HOME/.wine/drive_c/VARA\ FM/VARAFM.exe ]; then
11 | yad --title="FAILED" --width=400 --height=100 \
12 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
13 | --center --form --text="VARA FM Modem not installed" \
14 | --button=gtk-ok
15 | exit
16 | fi
17 |
18 | #Check if FLRIG is running if user has it set in config file
19 | if [ "$RIGCONTROL" = 'yes' ]; then
20 | echo "rig control is on"
21 | FLRIG=$(echo $RIG | grep "\-m 4")
22 | if [ ! -z "$FLRIG" ]; then
23 | FLRIG=$(pidof flrig)
24 | if [ -z "$FLRIG" ]; then
25 | yad --title="FAILED" --width=400 --height=100 \
26 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
27 | --center --form --text="Please start FLRIG and try again" \
28 | --button=gtk-ok
29 | exit
30 | fi
31 | fi
32 | fi
33 |
34 | #Check if modem is already running
35 | MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
36 | if [ ! -z "$MODEMCHECK" ]; then
37 | yad --title="FAILED" --width=400 --height=100 \
38 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
39 | --center --form --text="Packet Modem is already running" \
40 | --button=gtk-ok
41 | exit
42 | fi
43 |
44 | #check if piardopc is running
45 | PIDDW=$(pidof piardopc)
46 | if [ ! -z "$PIDDW" ]; then
47 | yad --title="FAILED" --width=400 --height=100 \
48 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
49 | --center --form --text="It looks like the ARDOP modem is running.\rStop all modems and try again" \
50 | --button=gtk-ok
51 | exit 0
52 | fi
53 |
54 | #check if direwolf is running
55 | PIDDW=$(pidof direwolf)
56 | if [ ! -z "$PIDDW" ]; then
57 | yad --title="FAILED" --width=400 --height=100 \
58 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
59 | --center --form --text="It looks like direwolf is running.\rStop all modems and try again" \
60 | --button=gtk-ok
61 | exit 0
62 | fi
63 |
64 | #give user some feedback
65 | yad --width=350 --height=75 --title="Starting Modem" --timeout=20 --timeout-indicator=top --no-buttons --center \
66 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Modem Starting....standby" &
67 |
68 | #Set Mode
69 | RIGFM=$RIG" M $MODE2M"
70 |
71 | SETRIG () {
72 |
73 | #set radio frequency & mode
74 | $RIGFM
75 |
76 | sleep 1
77 |
78 | #check rig is in correct mode
79 | MODE=$($RIG m | grep $MODE2M)
80 |
81 | sleep 1
82 |
83 | MODECHECK() {
84 | #check rig is in correct mode
85 | MODE=$($RIG m | grep $MODE2M)
86 | }
87 |
88 | sleep 1
89 |
90 | if [ -z $MODE ]
91 | then
92 | $RIGFM
93 | MODECHECK
94 | fi
95 | }
96 |
97 |
98 | #see if rig control is used
99 | if [ $RIGCONTROL == 'yes' ]; then
100 | PIDCTL=$(pidof rigctld)
101 | if [ -z "$PIDCTL" ]; then
102 | CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/')
103 | $CONTROL &
104 | rigpid=`echo $!`
105 | fi
106 | SETRIG
107 | fi
108 |
109 | echo "starting VARA-FM"
110 | /usr/local/bin/wine $HOME/.wine/drive_c/VARA\ FM/VARAFM.exe > /dev/null 2>&1 &
111 | sleep 7 #give vara time to start
112 |
113 | #verify vara has started
114 | PIDVARA=$(ps aux | grep -i wine | grep -i varafm)
115 | if [ -z "$PIDVARA" ]
116 | then
117 | yad --title="FAILED" --width=400 --height=100 \
118 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
119 | --center --form --text="The VARA Modem FAILED to Start" \
120 | --button=gtk-ok
121 |
122 | else
123 |
124 | yad --title="VARA MODEM" --width=400 --height=100 \
125 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
126 | --center --form --text="\r\r\r\rThe VARA Modem has Started\rJust a few more seconds" \
127 | --button=gtk-ok &
128 | fi
129 |
130 | sleep 1
131 | #restart pat so terminal window correctly reflects rig control
132 | sudo systemctl restart pat@`whoami`
133 |
134 | echo "starting browser"
135 | #open pat inbox in browser
136 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1
137 |
138 | #echo "cleaning up and closing"
139 | #varapid=`ps aux | grep -i box86 | grep -i varafm`
140 | #kill $varapid > /dev/null 2>&1
141 | #kill $rigpid > /dev/null 2>&1
142 |
143 |
--------------------------------------------------------------------------------
/start-vara-hf:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #script to start vara hf modem
4 | #10MARCH2022 KM4ACK
5 |
6 | MYPATH=$HOME/patmenu2
7 | LOGO=$MYPATH/pmlogo.png
8 | source $MYPATH/config
9 |
10 | #check if VARA HF modem is installed
11 | if [ ! -f $HOME/.wine/drive_c/VARA/VARA.exe ]; then
12 | yad --title="FAILED" --width=400 --height=100 \
13 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
14 | --center --form --text="VARA Modem not installed" \
15 | --button=gtk-ok
16 | exit
17 | fi
18 |
19 | #Check if FLRIG is running if user has it set in config file
20 | if [ "$RIGCONTROL" = 'yes' ]; then
21 | echo "rig control is on"
22 | FLRIG=$(echo $RIG | grep "\-m 4")
23 | if [ ! -z "$FLRIG" ]; then
24 | FLRIG=$(pidof flrig)
25 | if [ -z "$FLRIG" ]; then
26 | yad --title="FAILED" --width=400 --height=100 \
27 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
28 | --center --form --text="Please start FLRIG and try again" \
29 | --button=gtk-ok
30 | exit
31 | fi
32 | fi
33 | fi
34 |
35 | #Check if modem is already running
36 | MODEMCHECK=$(ps aux | grep -i wine | grep -i varafm)
37 | if [ ! -z "$MODEMCHECK" ]; then
38 | yad --title="FAILED" --width=400 --height=100 \
39 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
40 | --center --form --text="Packet Modem is already running" \
41 | --button=gtk-ok
42 | exit
43 | fi
44 |
45 | #check if piardopc is running
46 | PIDDW=$(pidof piardopc)
47 | if [ ! -z "$PIDDW" ]; then
48 | yad --title="FAILED" --width=400 --height=100 \
49 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
50 | --center --form --text="It looks like the ARDOP modem is running.\rStop all modems and try again" \
51 | --button=gtk-ok
52 | exit 0
53 | fi
54 |
55 | #check if direwolf is running
56 | PIDDW=$(pidof direwolf)
57 | if [ ! -z "$PIDDW" ]; then
58 | yad --title="FAILED" --width=400 --height=100 \
59 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
60 | --center --form --text="It looks like direwolf is running.\rStop all modems and try again" \
61 | --button=gtk-ok
62 | exit 0
63 | fi
64 |
65 | #give user some feedback
66 | yad --width=350 --height=75 --title="Starting Modem" --timeout=20 --timeout-indicator=top --no-buttons --center \
67 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --text="Modem Starting....standby" &
68 |
69 | #Set Mode
70 | RIGFM=$RIG" M $MODEHF"
71 |
72 | SETRIG () {
73 |
74 | #set radio frequency & mode
75 | $RIGFM
76 |
77 | sleep 1
78 |
79 | #check rig is in correct mode
80 | MODE=$($RIG m | grep $MODE2M)
81 |
82 | sleep 1
83 |
84 | MODECHECK() {
85 | #check rig is in correct mode
86 | MODE=$($RIG m | grep $MODE2M)
87 | }
88 |
89 | sleep 1
90 |
91 | if [ -z $MODE ]
92 | then
93 | $RIGFM
94 | MODECHECK
95 | fi
96 | }
97 |
98 |
99 | #see if rig control is used
100 | if [ $RIGCONTROL == 'yes' ]; then
101 | PIDCTL=$(pidof rigctld)
102 | if [ -z "$PIDCTL" ]; then
103 | CONTROL=$(cat $MYPATH/config | grep '^RIG="' | sed 's/RIG="//' | sed 's/"//' | sed 's/rigctl/rigctld/')
104 | $CONTROL &
105 | rigpid=`echo $!`
106 | fi
107 | SETRIG
108 | fi
109 |
110 | echo "starting VARA HF"
111 | /usr/local/bin/wine $HOME/.wine/drive_c/VARA/VARA.exe > /dev/null 2>&1 &
112 | sleep 7 #give vara time to start
113 |
114 | #verify vara has started
115 | PIDVARA=$(ps aux | grep -i wine | grep VARA.exe)
116 | if [ -z "$PIDVARA" ]
117 | then
118 | yad --title="FAILED" --width=400 --height=100 \
119 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
120 | --center --form --text="The VARA Modem FAILED to Start" \
121 | --button=gtk-ok
122 |
123 | else
124 |
125 | yad --title="VARA MODEM" --width=400 --height=100 \
126 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center --on-top \
127 | --center --form --text="\r\r\r\rThe VARA Modem has Started\rJust a few more seconds" \
128 | --button=gtk-ok &
129 | fi
130 |
131 | sleep 1
132 | #restart pat so terminal window correctly reflects rig control
133 | sudo systemctl restart pat@`whoami`
134 |
135 | echo "starting browser"
136 | #open pat inbox in browser
137 | export DISPLAY=:0 && xdg-open http://127.0.0.1:$PORT > /dev/null 2>&1
138 |
139 | #echo "cleaning up and closing"
140 | #varapid=`ps aux | grep -i box86 | grep VARA.exe`
141 | #kill $varapid > /dev/null 2>&1
142 | #kill $rigpid > /dev/null 2>&1
143 |
144 |
--------------------------------------------------------------------------------
/stop-modems:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #20191117 km4ack
4 | #20220614 edit by KM4ACK
5 |
6 | MYPATH=$HOME/patmenu2
7 | LOGO=$MYPATH/pmlogo.png
8 |
9 | #stop all modems that might be running
10 |
11 | sudo killall direwolf piardopc kissattach piARDOP_GUI rigctld > /dev/null 2>&1
12 | sudo rfcomm release /dev/rfcomm0 > /dev/null 2>&1
13 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
14 | kill -9 $VARA > /dev/null 2>&1
15 | VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
16 | kill -9 $VARA > /dev/null 2>&1
17 |
18 | yad --title="Modem Stopped" --width=400 --height=100 \
19 | --image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
20 | --center --form --text="\r\r\rModem has been stopped" \
21 | --button=gtk-ok
22 |
23 | sleep 2
24 |
25 | exit 0
--------------------------------------------------------------------------------
/weather.txt:
--------------------------------------------------------------------------------
1 | FALSE FPAK61.PAFC SOUTHCENTRAL-AK
2 | FALSE FPAK62.PAFC SW AK-&-ALEUTIAN ISLANDS
3 | FALSE FPCA62.TJSJ PR
4 | FALSE FPHW60.PHFO HI
5 | FALSE FPUS54.KHUN ZONE-FORECAST-TN-VALLEY
6 | FALSE FPUS61.KAKQ VA
7 | FALSE FPUS61.KBOX CT-MA-RI
8 | FALSE FPUS61.KBTV VT
9 | FALSE FPUS61.KBUF NY
10 | FALSE FPUS61.KCAR ME
11 | FALSE FPUS61.KCLE OH
12 | FALSE FPUS61.KCTP PA
13 | FALSE FPUS61.KGYX ME-NH
14 | FALSE FPUS61.KLWX MD PANHANDLE-WV
15 | FALSE FPUS61.KOKX NE-NJ-SE-NY-S-CT
16 | FALSE FPUS61.KPHI DE-NJ
17 | FALSE FPUS61.KRLX WV-KY-SE-OH-SE-VA
18 | FALSE FPUS62.KCAE SC
19 | FALSE FPUS62.KFFC GA
20 | FALSE FPUS62.KJAX NE-FL-SE-GA
21 | FALSE FPUS62.KKEY FL-KEYS
22 | FALSE FPUS62.KMFL FL
23 | FALSE FPUS62.KRAH NC
24 | FALSE FPUS62.KTAE TALLAHASSEE-FL-AREA
25 | FALSE FPUS63.KBIS ND
26 | FALSE FPUS63.KDMX IA
27 | FALSE FPUS63.KFSD SD
28 | FALSE FPUS63.KGRR MI
29 | FALSE FPUS63.KICT KS
30 | FALSE FPUS63.KILX IL
31 | FALSE FPUS63.KIND IN
32 | FALSE FPUS63.KLMK KY
33 | FALSE FPUS63.KLSX MO
34 | FALSE FPUS63.KMKX WI
35 | FALSE FPUS63.KMPX MN
36 | FALSE FPUS64.KBMX AL
37 | FALSE FPUS64.KBRO DEEP-SOUTH-TEXAS
38 | FALSE FPUS64.KCRP SOUTH-TEXAS
39 | FALSE FPUS64.KEPZ SW-SCENTRAL-NM-FAR-WEST-TEXAS
40 | FALSE FPUS64.KEWX SW-SCENTRAL-NM-FAR-WEST-TEXAS
41 | FALSE FPUS64.KFWD TX-FORT-WORTH-NWS
42 | FALSE FPUS64.KHGX SE-TX
43 | FALSE FPUS64.KHUN TAB-ST-TN-VALLEY-AND-N-AL
44 | FALSE FPUS64.KJAN MS
45 | FALSE FPUS64.KLIX LA
46 | FALSE FPUS64.KLZK AR
47 | FALSE FPUS64.KMAF TX-MIDLAND-NWS
48 | FALSE FPUS64.KOHX MIDDLE-TN
49 | FALSE FPUS64.KSJT TX-SAN-ANGELO-NWS
50 | FALSE FPUS64.KTSA E-OK-&-NW-AR
51 | FALSE FPUS65.KABQ N-&-CENTRAL-NM
52 | FALSE FPUS65.KBOI SW-ID-&-SE-OR
53 | FALSE FPUS65.KBOU CO
54 | FALSE FPUS65.KBYZ S-CENTRAL-&-SOUTHEASTERN-MT
55 | FALSE FPUS65.KCYS WY
56 | FALSE FPUS65.KFGZ AZ
57 | FALSE FPUS65.KGGW NE-MT
58 | FALSE FPUS65.KLKN NORTHEN-AND-CENTRAL-NV
59 | FALSE FPUS65.KPIH SE-ID
60 | FALSE FPUS65.KPSR SW-AZ-&-SE-CA
61 | FALSE FPUS65.KREV NV
62 | FALSE FPUS65.KSLC UT
63 | FALSE FPUS65.KVEF GREAT-BASIN-&-MOJAVE
64 | FALSE FPUS65.SFT N-AZ
65 | FALSE FPUS66.KEKA N-CA
66 | FALSE FPUS66.KLOX SOUTHERN-CA
67 | FALSE FPUS66.KMFR S-OR-&-N-CA
68 | FALSE FPUS66.KMTR SAN-FRANCISCO-BAY-AREA
69 | FALSE FPUS66.KOTX E-WA-&-N-ID
70 | FALSE FPUS66.KPDT NE-OR-&-SE-WA
71 | FALSE FPUS66.KPQR OREGON-TEXT-FORCAST
72 | FALSE FPUS66.KSEW NW-WA
73 | FALSE FPUS66.KSGX EXTREME-SW-CA
74 | FALSE FPUS66.KSTO N-&-CENTRAL CA
75 | FALSE FPUS66.KSTOA CA
76 | FALSE FPUS65.KVEF LAS-VEGAS-REGION-NV
77 |
--------------------------------------------------------------------------------
/worldgridmap.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/km4ack/patmenu2/e5ef6416c6a9619c1be06cbe0fc78aadbb55bcbf/worldgridmap.pdf
--------------------------------------------------------------------------------