forked from EA7KDO/NX4832K035
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchgmasterpwd.sh
executable file
·21 lines (20 loc) · 950 Bytes
/
chgmasterpwd.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
####################################################################
# Change Master password in /etc/mmdvmhost, #
# find old value and substitute with new value from Profie wcreen #
# that was passed in $1. #
# #
# KF6S 05-20-2019 #
####################################################################
set -o errexit
set -o pipefail
# Use passed DMR Master if present or default to TGIF if missing
if [ -z "$1" ]; then
NewHostPWD="Password=passw0rd"
else
NewHostPWD="Password="$1
fi
# Get old Host Password from /etc/mmdvmhost
OldHostPWD=$(sudo cat /etc/mmdvmhost | grep "\[DMR Network\]" -A 10 | grep "Password")
# Replace with host password that was selected on the Profile Nextion screen
sudo sed -i 's+'"$OldHostPWD"'+'"$NewHostPWD"'+' /etc/mmdvmhost;