-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmnet.sh
More file actions
executable file
·73 lines (53 loc) · 1.58 KB
/
mnet.sh
File metadata and controls
executable file
·73 lines (53 loc) · 1.58 KB
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
#!/bin/bash
#########################################################################
# MNet_Network Support #
# This Script will install The MNet Security Password into #
# /root/DMR_Hosts.txt and run the Pi-Star Host File Updatde Routine #
# and add the required line to /root/DMR_Hosts.txt if it was #
# not found in ether file. #
# Place the Security Password into /home/pi-star/MNet.txt #
# #
# VE3RD 2020-08-22 #
#########################################################################
export NCURSES_NO_UTF8_ACS=1
declare -i slen
if [ "$1" ]; then
sc1="$1"
slen1=$(expr length "$sc1")
if [ "$slen1" != 15 ]; then
echo "Wrong String Length for Security Password"
exit
fi
m4="$sc1"
else
if [ -f /home/pi-star/MNet.txt ]; then
sc1=$(cat /home/pi-star/MNet.txt)
slen1=$(expr length "$sc1")
if [ "$slen1" != 15 ]; then
echo "Wrong String Length for Security Password"
exit
fi
m4="$sc1"
else
echo "Security Password Not Found"
exit
fi
fi
sudo mount -o remount,rw /
slen2=$(expr length "$sc2")
echo "$sc1"
echo "$sc2"
m1="MNet_Network"
m2="0000"
m3="mnet.hopto.org"
m5="62031"
textstr="$m1\t\t$m2\t$m3\t\t\t$m4\t\t$m5"
sudo sed -i "\$a$textstr" /root/DMR_Hosts.txt
echo "Updating Hostfiles..."
sudo /usr/local/sbin/HostFilesUpdate.sh
if [ "$?" == "0" ]; then
echo "Host Files Successfully Updated"
else
echo "Host File Update Failed!"
fi
echo ""