forked from EA7KDO/NX4832K035
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetmode.sh
executable file
·29 lines (23 loc) · 1.14 KB
/
getmode.sh
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
#!/bin/bash
############################################################
# Get Mode from /etc/mmdvmhost #
# $1 1-6 Select Mode to get status of #
# #
# Returns the status Enable=0 or 1 #
# #
# KF6S 09-01-2019 #
############################################################
set -o errexit
set -o pipefail
if [ "$1" = 1 ]; then sudo cat /etc/mmdvmhost | grep "\[D-Star\]" -A 1 | grep "Enable=" | cut -b 8-9
fi
if [ "$1" = 2 ]; then sudo cat /etc/mmdvmhost | grep "\[DMR\]" -A 1 | grep "Enable=" | cut -b 8-9
fi
if [ "$1" = 3 ]; then sudo cat /etc/mmdvmhost | grep "\[System Fusion\]" -A 1 | grep "Enable=" | cut -b 8-9
fi
if [ "$1" = 4 ]; then sudo cat /etc/mmdvmhost | grep "\[P25\]" -A 1 | grep "Enable=" | cut -b 8-9
fi
if [ "$1" = 5 ]; then sudo cat /etc/mmdvmhost | grep "\[NXDN\]" -A 1 | grep "Enable=" | cut -b 8-9
fi
if [ "$1" = 6 ]; then sudo cat /etc/mmdvmhost | grep "\[POCSAG\]" -A 1 | grep "Enable=" | cut -b 8-9
fi