-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathupdAX25.sh
More file actions
198 lines (185 loc) · 5.69 KB
/
updAX25.sh
File metadata and controls
198 lines (185 loc) · 5.69 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
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
#!/bin/bash
# script updated October-22-2017 for VE7FET new AX.25 github repository (F6BVP)
# script update January-13-2019 by VE7FET to correct error checking and update for installconf changes
# Copy this script file in /usr/local/src/ax25/updAX25.sh
# cd into /usr/local/src/ax25
# and execute command : sudo chmod a+x updAX25.sh
# execute command to run the script : ./updAX25.sh
# It will update and re-compile AX.25 libraries, AX.25 tools and AX.25 apps
LIBAX25=linuxax25-master/libax25/
TOOLS=linuxax25-master/ax25tools/
APPS=linuxax25-master/ax25apps/
# Color Codes
Reset='\e[0m'
Red='\e[31m'
Green='\e[30;42m' # Black/Green
Yellow='\e[33m'
YelRed='\e[31;43m' #Red/Yellow
Blue='\e[34m'
White='\e[37m'
BluW='\e[37;44m'
echo -e "${BluW}\t\n\t Script provided by Charles S. Schuman modified by F6BVP for updating AX.25 libraries and applications\t\n\t\t\t ${Red} January-13-2019 \n \t\t${Yellow} k4gbb1@gmail.com \n${Reset}"
if ! uid=0
then su
fi
#if [ -f /usr/lib/libax25.a ]; then
echo -e "${Green} Removing Old Libax25 files out of the way${Reset}"
rm -fr /usr/lib/libax25*
rm -fr /usr/lib/libax25*.*
#fi
# Make directories if not exist
if [ -d /usr/local/src/ax25/ ]
then echo "directory /usr/local/src/ax25 already exists"
else
mkdir /usr/local/src/ax25/
fi
if ! [ -d /usr/local/etc/ax25/ ]
then mkdir /usr/local/etc/ax25/
fi
if ! [ -d /usr/local/var/ax25/ ]
then
mkdir /usr/local/var/
mkdir /usr/local/var/ax25
fi
#
# Download libax25 source file
cd /usr/local/src/ax25
rm -fr /usr/local/src/ax25/libax25
rm -f master.zip
echo -e "${Green} Getting AX25 libraries, AX25 tools and AX25 apps archives${Reset}"
wget https://github.com/ve7fet/linuxax25/archive/master.zip
if [ $? -ne 0 ]
then
echo -e "${Red}\t Ax25 Source files are Missing${Reset}"
exit 1
fi
echo -e "${Green} Now unarchiving AX.25 files${Reset}"
rm -fr linuxax25-master
unzip master.zip
#Libax25 (updating configure.ac for automake > 1.12 compliance)
cd /usr/local/src/ax25/$LIBAX25
#
echo -e "${Green}\t Creating Makefile(s) to prepare libraries compilation${Reset}"
./autogen.sh
./configure > liberror.txt 2>&1
echo -e -n "\t *"
echo -e "${Green}\t Compiling Runtime Lib files${Reset}"
# Clean old binaries
make clean
if [ $? -ne 0 ]
then
echo -e "${Red}\t Libax25 Compile error - See liberror.txt${Reset}"
exit 1
fi
# Compile
echo -n " *"
make
if [ $? -ne 0 ]
then
echo -e "${Red}\t Libax25 Compile error - See liberror.txt${Reset}"
exit 1
fi
echo " *\n"
# Install
# make install >> liberror.txt 2>&1
make install
if [ $? -ne 0 ]
then
echo -e "${Red} Libax25 Install error - See liberror.txt${Reset}"
exit 1
else
echo -e "${Green} Libax25 Installed${Reset}"
rm liberror.txt
fi
# AX25 libraries symbolic name needed for some applications
cd /usr/local/lib/
ln -s libax25.so libax25.so.0
# AX25 libraries declaration (into ld.so.conf)
echo "/usr/local/lib" >> /etc/ld.so.conf && /sbin/ldconfig
# AX25-APPS
cd /usr/local/src/ax25
rm -fr /usr/local/src/ax25/ax25apps
echo -e "${Green} AX.25 applications${Reset}"
#Libax25 (updating configure.ac for automake > 1.12 compliance)
cd /usr/local/src/ax25/$APPS
#
echo -e "${Green}\t Creating Makefile(s) to prepare apps compilation${Reset}"
./autogen.sh
./configure > appserror.txt 2>&1
echo -n -e "\t *"
# Clean old binaries
make clean
if [ $? -ne 0 ]
then
echo -e "${Red}\t Ax25-Apps Compile Error - see appserror.txt${Reset}"
exit 1
fi
# Compile Ax25-apps
echo -n " *"
echo -e "${Green}\t Compiling Ax25 apps ${Reset}"
make
if [ $? -ne 0 ]
then
echo -e "${Red}\t Ax25-Apps Compile Error - see appserror.txt${Reset}"
exit 1
fi
# Install Ax25-apps
echo " *"
# make install >> appserror.txt 2>&1
make install
if [ $? -ne 0 ]
then
echo -e "${Red} Ax25-Apps Install Error - see appserror.txt${Reset}"
exit 1
else
echo -e "${Green} Ax25-apps Installed${Reset}"
rm appserror.txt
fi
# AX25-TOOLS
cd /usr/local/src/ax25
rm -fr /usr/local/src/ax25/ax25tools
echo -e "${Green} AX.25 tools${Reset}"
cd /usr/local/src/ax25/$TOOLS
#
echo -n -e "\t *"
echo -e "${Green}\t Creating Makefile(s) to prepare apps compilation${Reset}"
./autogen.sh
./configure > toolserror.txt 2>&1
# Clean old binaries
make clean
if [ $? -ne 0 ]
then
echo -e "${Red}\t AX.25 tools Compile error - See toolserror.txt${Reset}"
exit 1
fi
# Compile Ax.25 tools
echo -e "${Green}\t Compiling AX.25 tools${Reset}"
echo -e "\t *"
make
if [ $? -ne 0 ]
then
echo -e "${Red}\t AX.25 tools Compile error - See toolserror.txt${Reset}"
exit 1
fi
# Install Ax.25 tools
echo " *"
make install
if [ $? -ne 0 ]
then
echo -e "${Red}\t AX.25 tools Install error - See toolserror.txt${Reset}"
exit 1
else
echo -e "${Green} AX.25 tools Installed${Reset}"
rm toolserror.txt
fi
# Set permissions for /usr/local/sbin/ and /usr/local/bin
# cd /usr/local/sbin/
# chmod 4775 *
# cd /usr/local/bin/
# chmod 4775 *
echo -e "\t \e[030;42m Ax.25 Libraries, applications and tools were successfully rebuilt and installed${Reset}"
echo -e "${Green} If this is a first install of AX.25 tools or apps, sample config files were installed in the doc ${Reset}"
echo -e "${Green} folder on your system. This is likely something like /usr/local/share/doc or /usr/share/doc. ${Reset}"
echo -e "${Green} Look in doc/ax25apps/conf and doc/ax25tools/conf for sample conf files, and copy them to your ${Reset}"
echo -e "${Green} etc/ax25 folder and edit (may be /etc/ax25 or /usr/local/etc/ax25, depending on your system).${Reset}"
# (End of Script)