forked from nostar/urfd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrconfig
executable file
·653 lines (624 loc) · 18.5 KB
/
rconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
#!/bin/bash
#
# Copyright (c) 2021 by Thomas A. Early N7TAE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#!/bin/bash
CharCount () {
local haystack=$1
local test="\${haystack//[^$2]}"
eval local result=$test
return ${#result}
}
RemoveDupes () {
local -n s=$1
local i j
for (( i=0; i<${#s}-1; i++)); do
for (( j=$i+1; j<${#s}; j++)); do
if [[ ${s:$i:1} != "." ]]; then
if [[ ${s:$i:1} == ${s:$j:1} ]]; then
local l=$(($j + 1))
s="${s:0:$j}.${s:$l}"
fi
fi
done
done
s=${s//.}
}
CheckModules () {
# only A through Z
modules=${1//[^A-Z]}
if (( ${#modules} < 1 )); then
unset modules
clear
echo "ERROR: You must specify at least one module, A to Z!"
echo
read -p "<Enter> to continue: " ans
return
fi
RemoveDupes modules
tcmodules=${modules:0:1}
}
CheckTranscodedModules () {
local tc=${1//[^A-Z]}
local tcorig=$tc
if (( ${#tc} < 1 )); then
tcmodules=${modules:0:1}
clear
echo "ERROR: You must specify at least one module!"
echo "If you aren't using a transcoder, set the transcoder"
echo "address value to the default 'none'!"
echo
read -p "<Enter> to continue: " ans
return
fi
RemoveDupes tc
local m=$modules_d
if [ ! -z ${modules+x} ]; then
m=$modules
fi
local i
for ((i=0; i<${#tc}; i++)); do
CharCount $m ${tc:$i:1}
local count=$?
if (( $count < 1 )); then
local j=$((i+1))
tc="${tc:0:$i}.${tc:$j}"
fi
done
tc=${tc//.}
if (( ${#tc} < 1 )); then
echo "ERROR: Module(s), '$tcorig', are not in the configure modules, '$m'!"
echo
read -p "<Enter> to continue: " ans
tcmodules=${modules:0:1}
return
fi
tcmodules=$tc
}
SetBooleanValue ()
{
local dvname
local cv
if [ -z $2 ]; then
if [ -z ${!1+x} ]; then
if [[ "$1" == module_[abc]_* ]]; then
echo matches
dvname=${1//_[abc]_/_x_}
else
echo does not match
dvname=${1}_d
fi
cv=${!dvname}
else
cv=${!1}
fi
if [[ $cv == [tT]* ]]; then
eval ${1}=false
else
eval ${1}=true
fi
elif [[ "$2" == [tT]* ]]; then
eval ${1}=true
else
eval ${1}=false
fi
}
EvaluateVar ()
{
if [ -z ${!1+x} ]; then
if [ -z "${!2}" ]; then
echo "'' <DEFAULT>"
else
echo "${!2} <DEFAULT>"
fi
else
if [ -z "${!1}" ]; then
echo "''"
else
echo "${!1}"
fi
fi
}
TestGainValue ()
{
if [[ "$1" =~ ^[-]?[0-9]+$ ]]; then
if (( $1 >= -24 && $1 <= 24 )); then
return 0
else
return 1
fi
else
return 1
fi
}
AudioGainMenu ()
{
while [[ "$key" != q* ]]
do
clear
echo
echo " DVSI AMBE Chip Audio Gain Menu"
echo
echo " All values are in dB and can be from -24 to 24"
echo " 'input' means the audio amplitude is adjusted before encoding"
echo " 'output' means the audio amplitude is adjusted after decoding"
echo
echo " Non-zero values are generally not required!"
echo " USE AT YOUR OWN RISK!"
echo
echo -n "si : D-Star audio input = "; EvaluateVar dstar_in_gain{,_d}
echo -n "so : D-Star audio output = "; EvaluateVar dstar_out_gain{,_d}
echo -n "mi : DMR/YSF audio input = "; EvaluateVar dmr_in_gain{,_d}
echo -n "mo : DMR/YSF audio output = "; EvaluateVar dmr_out_gain{,_d}
echo
echo "q : Return to Main Menu"
echo "u : Unset the value of <key> (revert to the default value)."
echo
read -p "Please input <key> <value> : " key value
if [[ "$key" == si* ]]; then
TestGainValue "$value" && dstar_in_gain="$value"
elif [[ "$key" == so* ]]; then
TestGainValue "$value" && dstar_out_gain="$value"
elif [[ "$key" == mi* ]]; then
TestGainValue "$value" && dmr_in_gain="$value"
elif [[ "$key" == mo* ]]; then
TestGainValue "$value" && dmr_out_gain="$value"
elif [[ "$key" == u* ]]; then
if [[ "$value" == si* ]]; then
unset dstar_in_gain
elif [[ "$value" == so* ]]; then
unset dstar_out_gain
elif [[ "$value" == mi* ]]; then
unset dmr_in_gain
elif [[ "$value" == mo* ]]; then
unset dmr_out_gain
fi
fi
done
}
WriteMemFile ()
{
local file
file="$rcfg"
echo "# created on `date`" > $file
[ -z ${callsign+x} ] || echo "callsign='$callsign'" >> $file
[ -z ${modules+x} ] || echo "modules='$modules'" >> $file
[ -z ${ip4addr+x} ] || echo "ip4addr='$ip4addr'" >> $file
[ -z ${ip6addr+x} ] || echo "ip6addr='$ip6addr'" >> $file
[ -z ${tcaddress+x} ] || echo "tcaddress='$tcaddress'" >> $file
[ -z ${tcmodules+x} ] || echo "tcmodules='$tcmodules'" >> $file
[ -z ${dstar_in_gain+x} ] || echo "dstar_in_gain=$dstar_in_gain" >> $file
[ -z ${dstar_out_gain+x} ] || echo "dstar_out_gain=$dstar_out_gain" >> $file
[ -z ${dmr_in_gain+x} ] || echo "dmr_in_gain=$dmr_in_gain" >> $file
[ -z ${dmr_out_gain+x} ] || echo "dmr_out_gain=$dmr_out_gain" >> $file
[ -z ${dmrdbuseserver+x} ] || echo "dmrdbuseserver=$dmrdbuseserver" >> $file
[ -z ${dmrdbrefresh+x} ] || echo "dmrdbrefresh=$dmrdbrefresh" >> $file
[ -z ${dmrdbpath+x} ] || echo "dmrdbpath='$dmrdbpath'" >> $file
[ -z ${ysfautolink+x} ] || echo "ysfautolink=$ysfautolink" >> $file
[ -z ${ysfmodule+x} ] || echo "ysfmodule='$ysfmodule'" >> $file
[ -z ${ysflocaldb+x} ] || echo "ysflocaldb=$ysflocaldb" >> $file
[ -z ${ysfdbname+x} ] || echo "ysfdbname='$ysfdbname'" >> $file
[ -z ${ysfdbuser+x} ] || echo "ysfdbuser='$ysfdbuser'" >> $file
[ -z ${ysfrname+x} ] || echo "ysfrname='$ysfrname'" >> $file
[ -z ${ysfrdesc+x} ] || echo "ysfrdesc='$ysfrdesc'" >> $file
[ -z ${ysfdbpw+x} ] || echo "ysfdbpw='$ysfdbpw'" >> $file
[ -z ${g3support+x} ] || echo "g3support=$g3support" >> $file
[ -z ${dbsupport+x} ] || echo "dbsupport=$dbsupport" >> $file
}
WriteSRCHFile ()
{
local file m
file="$srch"
echo "// Created on `date`" > $file
echo "#define CALLSIGN \"${callsign}\"" >> $file
if [[ "$callsign" == XRF* ]]; then
echo "#define NO_XLX" >> $file
fi
if [ -z ${modules+x} ]; then
echo "#define ACTIVE_MODULES \"${modules_d}\"" >> $file
else
echo "#define ACTIVE_MODULES \"${modules}\"" >> $file
fi
if [ ! -z ${ip4addr+x} ]; then
echo "#define LISTEN_IPV4 \"${ip4addr}\"" >> $file
fi
if [ ! -z ${ip6addr+x} ]; then
echo "#define LISTEN_IPV6 \"${ip6addr}\"" >> $file
fi
if [ -z ${ysfautolink+x} ]; then
echo "#define YSF_AUTOLINK_ENABLE ${ysfautolink_d}" >> $file
else
echo "#define YSF_AUTOLINK_ENABLE ${ysfautolink}" >> $file
fi
if [ -z ${ysfmodule+x} ]; then
echo "#define YSF_AUTOLINK_MODULE '${ysfmodule_d}'" >> $file
else
echo "#define YSF_AUTOLINK_MODULE '${ysfmodule}'" >> $file
fi
if [ ! -z ${dmrdbuseserver+x} ]; then
if [[ "$dmrdbuseserver" == true ]]; then
m=1
else
m=0
fi
else
m=1
fi
echo "#define DMRIDDB_USE_RLX_SERVER $m" >> $file
if [ ! -z ${dmrdbrefresh+x} ]; then
echo "#define DMRIDDB_REFRESH_RATE $dmrdbrefresh" >> $file
else
echo "#define DMRIDDB_REFRESH_RATE $dmrdbrefresh_d" >> $file
fi
if [ ! -z ${dmrdbpath+x} ]; then
echo "#define DMRIDDB_PATH \"$dmrdbpath\"" >> $file
else
echo "#define DMRIDDB_PATH \"$dmrdbpath_d\"" >> $file
fi
if [[ "$ysflocaldb" == true ]]; then
echo '#define YSF_DB_SUPPORT true' >> $file
echo "#define YSF_DB_NAME \"$ysfdbname\"" >> $file
echo "#define YSF_DB_USER \"$ysfdbuser\"" >> $file
echo "#define YSF_DB_PASSWORD \"$ysfdbpw\"" >> $file
else
echo '#define YSF_DB_SUPPORT false' >> $file
fi
if [ ! -z ${ysfrname+x} ]; then
echo "#define YSF_REFLECTOR_NAME \"$ysfrname\"" >> $file
fi
if [ ! -z ${ysfrdesc+x} ]; then
echo "#define YSF_REFLECTOR_DESCRIPTION \"$ysfrdesc\"" >> $file
fi
if [ ! -z ${tcaddress+x} ]; then
echo "#define TRANSCODER_IP \"${tcaddress}\"" >> $file
echo "#define TRANSCODED_MODULES \"${tcmodules}\"" >> $file
fi
if [ -z ${g3support+x} ]; then
m=${g3support_d}
else
m=${g3support}
fi
if [[ "$m" != true ]]; then
echo "#define NO_G3" >> $file
fi
if [ -n ${dbsupport+x} ]; then
if [ "$dbsupport" == true ]; then
echo "#define DEBUG" >> $file
fi
fi
}
WriteSRCMKFile ()
{
local file
file="$srcm"
echo "# Created on `date`" > $file
[ -z ${ip4addr+x} ] || echo "ipv4 = $ip4addr" >> $file
[ -z ${ip6addr+x} ] || echo "ipv6 = $ip6addr" >> $file
[ -z ${tcaddress+x} ] || echo "tc_ip = $tcaddress" >> $file
if [ -z ${g3support+x} ]; then
echo "use_g3 = $g3support_d" >> $file
else
echo "use_g3 = $g3support" >> $file
fi
if [ -z ${dbsupport+x} ]; then
echo "debug = $dbsupport_d" >> $file
else
echo "debug = $dbsupport" >> $file
fi
if [ -z ${ysflocaldb+x} ]; then
echo "ysf_db = $ysflocaldb_d" >> $file
else
echo "ysf_db = $ysflocaldb" >> $file
fi
}
WriteTranscoderHFile ()
{
local file
file="$tcdh"
echo "// Created on `date`" > $file
if [ -n ${tcaddress+x} ] && [[ "$tcaddress" != "local" ]]; then
echo "#define TRANSCODER_IP \"${tcaddress}\"" >> $file
fi
if [ -n ${tcmodules+x} ]; then
echo "#define TRANSCODED_MODULES \"${tcmodules}\"" >> $file
fi
if [ -z ${dstar_in_gain+x} ]; then
echo "#define DSTAR_IN_GAIN $dstar_in_gain_d" >> $file
else
echo "#define DSTAR_IN_GAIN $dstar_in_gain" >> $file
fi
if [ -z ${dstar_out_gain+x} ]; then
echo "#define DSTAR_OUT_GAIN $dstar_out_gain_d" >> $file
else
echo "#define DSTAR_OUT_GAIN $dstar_out_gain" >> $file
fi
if [ -z ${dmr_in_gain+x} ]; then
echo "#define DMR_IN_GAIN $dmr_in_gain_d" >> $file
else
echo "#define DMR_IN_GAIN $dmr_in_gain" >> $file
fi
if [ -z ${dmr_out_gain+x} ]; then
echo "#define DMR_OUT_GAIN $dmr_out_gain_d" >> $file
else
echo "#define DMR_OUT_GAIN $dmr_out_gain" >> $file
fi
if [ -n ${dbsupport+x} ]; then
if [ "$dbsupport" == true ]; then
echo "#define DEBUG" >> $file
fi
fi
}
WriteTranscoderMKFile ()
{
local file
file="$tcdm"
echo "# created on `date`" > $file
if [ -z ${dbsupport+x} ]; then
echo "debug = $dbsupport_d" >> $file
else
echo "debug = $dbsupport" >> $file
fi
}
WriteCfgPhpFile ()
{
cat << EOF > $ysfs
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', '${ysfdbuser}');
define('DB_PASSWORD', '${ysfdbpw}');
define('DB_NAME', '${ysfdbname}');
// Attempt to connect to MySQL database
\$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if (\$link === false) { die("ERROR: Could not connect. " . mysqli_connect_error()); }
?>
EOF
}
WriteDBCreateFile ()
{
cat << EOF > $dbcr
CREATE DATABASE IF NOT EXISTS ${ysfdbname};
USE ${ysfdbname};
CREATE TABLE IF NOT EXISTS ysfnodes (
callsign VARCHAR(7) PRIMARY KEY,
password VARCHAR(255) NOT NULL,
txfreq INT NOT NULL DEFAULT 446500000,
rxfreq INT NOT NULL DEFAULT 446500000,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE USER IF NOT EXISTS '${ysfdbuser}'@'localhost' IDENTIFIED BY '${ysfdbpw}';
GRANT ALL PRIVILEGES ON $ysfdbname . ysfnodes TO '${ysfdbuser}'@'localhost';
FLUSH PRIVILEGES;
EOF
}
WriteCFGFiles ()
{
WriteMemFile
WriteSRCHFile
WriteSRCMKFile
if [ -z ${tcaddress+x} ]; then
rm -f $tcdh $tcdm
else
WriteTranscoderHFile
WriteTranscoderMKFile
fi
if [[ "$ysflocaldb" == true ]]; then
WriteCfgPhpFile
WriteDBCreateFile
else
rm -f $ysfs $dbcr
fi
}
ListCFGFiles ()
{
echo "===========${rcfg}============="
cat $rcfg
echo "===========${srch}============="
cat $srch
echo "===========${srcm}============="
cat $srcm
if [ ! -z ${tcaddress+x} ]; then
echo "===========${tcdh}============="
cat $tcdh
echo "===========${tcdm}============="
cat $tcdm
fi
if [[ "$ysflocaldb" == true ]]; then
echo "===========${ysfs}============="
cat $ysfs
echo "===========${dbcr}============="
cat $dbcr
fi
}
# Execution starts here!
# file locations
rcfg='reflector.cfg'
srch='reflector/configure.h'
srcm='reflector/configure.mk'
tcdh='../tcd/configure.h'
tcdm='../tcd/configure.mk'
ysfs='wiresx/configure.php'
dbcr='configure.sql'
urfserv='/etc/systemd/system/urfd.service'
# expert mode
if [[ "$1" == ex* ]]; then
expertmode="expertMode"
fi
if [ -e reflector.cfg ]; then
source reflector.cfg
else
echo 'No configuration file found...'
sleep 1
fi
# default values
callsign_d='CHNGME'
modules_d='ABCF'
ip4addr_d='none'
ip6addr_d='none'
tcaddress_d='none'
ysfautolink_d=false
ysfmodule_d='D'
g3support_d=false
dbsupport_d=false
dmrdbuseserver_d=true
dmrdbrefresh_d=180
dmrdbpath_d='/usr/local/etc/dmrid.dat'
ysflocaldb_d=false
ysfdbname_d=''
ysfdbuser_d=''
ysfdbpw_d=''
dstar_in_gain_d=0
dstar_out_gain_d=0
dmr_in_gain_d=0
dmr_out_gain_d=0
if [ -z ${callsign+x} ];then
ysfrname_d="$callsign_d"
else
ysfrname_d="$callsign"
fi
ysfrdesc_d='URF Reflector'
if [ -z ${expertmode+x} ]; then
if [ -e $urfserv ]; then
echo -n "You cannot change the configuration right now beacuse there is an "
if [ -e $urfserv ]; then
echo "URFD server running."
fi;
echo "===========${rcfg}============="
cat $rcfg
echo
echo "Please use radmin to uninstall the running server before attempting to modify the configuration."
exit 1
fi
fi
key='x'
# main loop
while [[ "$key" != q* ]]
do
clear
echo
echo " Reflector Configuration, Version #220326"
echo
echo " ******* REFLECTOR ********"
echo -n "cs : Reflector Callsign = "; EvaluateVar callsign{,_d}
echo -n "am : Active Modules = "; EvaluateVar modules{,_d}
echo -n "g3 : Icom G3 Support = "; EvaluateVar g3support{,_d}
echo " ******* ADDRESSES ********"
echo -n "i4 : IPv4 Listen Address = "; EvaluateVar ip4addr{,_d}
echo -n "i6 : IPv6 Listen Address = "; EvaluateVar ip6addr{,_d}
echo " ******* TRANSCODER ********"
echo " The only TC address supported is 'local' or the default 'none'"
echo -n "tc : Transcoder Address = "; EvaluateVar tcaddress{,_d}
if [ ! -z ${tcaddress+x} ]; then
echo -n "tm : Transcoder Modules = "; EvaluateVar tcmodules{,_d}
echo "ag : AMBE Audio Gain Sub-Menu"
if [ ! -z ${dstar_in_gain+x} ]; then
echo -n " D-Star Input gain = "; EvaluateVar dstar_in_gain{,_d}
fi
if [ ! -z ${dstar_out_gain+x} ]; then
echo -n " D-Star Output gain = "; EvaluateVar dstar_out_gain{,_d}
fi
if [ ! -z ${dmr_in_gain+x} ]; then
echo -n " DMR Input gain = "; EvaluateVar dmr_in_gain{,_d}
fi
if [ ! -z ${dmr_out_gain+x} ]; then
echo -n " DMR Output gain = "; EvaluateVar dmr_out_gain{,_d}
fi
fi
echo " ******* DMR Database ********"
echo -n "ds : Use RLX Server = "; EvaluateVar dmrdbuseserver{,_d}
echo -n "dt : Refresh time (in min) = "; EvaluateVar dmrdbrefresh{,_d}
echo -n "dp : Database path = "; EvaluateVar dmrdbpath{,_d}
echo " ******* SYSTEM FUSION ********"
echo -n "ye : YSF Autolink Enable = "; EvaluateVar ysfautolink{,_d}
if [ ! -z ${ysfautolink+x} ]; then
if [[ "$ysfautolink" == true ]]; then
echo -n "ym : YSF Autolink Module = "; EvaluateVar ysfmodule{,_d}
fi
fi
echo -n "yl : YSF Local Database = "; EvaluateVar ysflocaldb{,_d}
if [[ "$ysflocaldb" == true ]]; then
echo -n "yd : YSF Database Name = "; EvaluateVar ysfdbname{,_d}
echo -n "yu : YSF Database User = "; EvaluateVar ysfdbuser{,_d}
echo -n "yp : YSF Database Password = "; EvaluateVar ysfdbpw{,_d}
fi
echo " ******* YSFReflector Registry *******"
echo -n "rn : Registry Name = "; EvaluateVar ysfrname{,_d}
echo -n "rd : Registry Description = "; EvaluateVar ysfrdesc{,_d}
echo " ******* DEBUGGING ********"
echo -n "db : Debugging Support = "; EvaluateVar dbsupport{,_d}
echo
if [[ "$callsign" == URF* ]]; then
echo "w : Write configuration files (overwrites any existing files) and quit"
fi
echo "q : Quit without saving"
echo "u : Unset the value of <key> (revert to the default value)."
echo
read -p "Please input <key> <value> - omit value to toggle a true/false : " key value
if [[ "$key" == cs* && ${value^^} == URF* ]]; then
callsign="${value^^}"
callsign="${callsign:0:6}"
ysfrname_d="${callsign}"
unset tcaddress tcmodules ysf{autolink,module,localdb,dbname,dbuser,dbpw}
elif [[ "$key" == am* ]]; then CheckModules "${value^^}"
elif [[ "$key" == i4* ]]; then ip4addr="$value"
elif [[ "$key" == i6* ]]; then ip6addr="$value"
elif [[ "$key" == tc* ]]; then tcaddress="local"
elif [[ "$key" == tm* ]]; then CheckTranscodedModules "${value^^}"
elif [[ "$key" == ag* ]]; then
AudioGainMenu
key=x
elif [[ "$key" == ds* ]]; then SetBooleanValue dmrdbuseserver "$value"
elif [[ "$key" == dt* ]]; then dmrdbrefresh="$value"
elif [[ "$key" == dp* ]]; then dmrdbpath="$value"
elif [[ "$key" == ye* ]]; then SetBooleanValue ysfautolink "$value"
elif [[ "$key" == ym* ]]; then
ysfmodule="${value^^}"
ysfmodule="${ysfmodule:0:1}"
elif [[ "$key" == g3* ]]; then SetBooleanValue g3support "$value"
elif [[ "$key" == db* ]]; then SetBooleanValue dbsupport "$value"
elif [[ "$key" == yl* ]]; then SetBooleanValue ysflocaldb "$value"
elif [[ "$key" == yd* ]]; then ysfdbname="$value"
elif [[ "$key" == yu* ]]; then ysfdbuser="$value"
elif [[ "$key" == yp* ]]; then ysfdbpw="$value"
elif [[ "$key" == rn* ]]; then ysfrname="${value:0:16}"
elif [[ "$key" == rd* ]]; then ysfrdesc="${value:0:14}"
elif [[ "$key" == w* ]]; then
WriteCFGFiles
ListCFGFiles
exit 0
elif [[ "$key" == u* ]]; then
if [[ "$value" == cs* ]]; then unset callsign
elif [[ "$value" == am* ]]; then unset modules
elif [[ "$value" == i4* ]]; then unset ip4addr
elif [[ "$value" == i6* ]]; then unset ip6addr
elif [[ "$value" == tc* ]]; then unset tcaddress
elif [[ "$value" == tm* ]]; then tcmodules=${modules:0:1}
elif [[ "$value" == ds* ]]; then unset dmrdbuseserver
elif [[ "$value" == dt* ]]; then unset dmrdbrefresh
elif [[ "$value" == dp* ]]; then unset dmrdbpath
elif [[ "$value" == ye* ]]; then unset ysfautolink ysfmodule
elif [[ "$value" == ym* ]]; then unset ysfmodule
elif [[ "$value" == g3* ]]; then unset g3support
elif [[ "$value" == db* ]]; then unset dbsupport
elif [[ "$value" == yl* ]]; then unset ysflocaldb ysfdbname ysfdbuser ysfdbpw
elif [[ "$value" == yd* ]]; then unset ysfdbname
elif [[ "$value" == yu* ]]; then unset ysfdbuser
elif [[ "$value" == yp* ]]; then unset ysfdbpw
elif [[ "$value" == rn* ]]; then unset ysfrname
elif [[ "$value" == rd* ]]; then unset ysfrdesc
fi
fi
done
exit 0