Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·88 lines (86 loc) · 3 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·88 lines (86 loc) · 3 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
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-or-later
# Script.sh
#
#
# Created by Idel Fuschini on 10/02/2014
# and contributed by Dany Gielow
# last revision 09/03/2017
#
clear
echo "*********************************************"
echo "*** APACHE MOBILE FILTER + INSTALLER ***"
echo "*********************************************"
echo
run_apxs() {
if [ "$(id -u)" -eq 0 ]; then
"$apxs" "$@"
elif command -v sudo >/dev/null 2>&1; then
sudo "$apxs" "$@"
else
"$apxs" "$@"
fi
}
var=0;
while [ $var -eq 0 ]
do
myapxs=`command -v apxs2 || command -v apxs`
#echo "Found apxs/apxs2: $myapxs"
echo "Please confirm the path to apxs/apxs2 [$myapxs]:"
read apxs
if [ -z "$apxs" ]; then
apxs=$myapxs
fi
if [ -f "$apxs" ]; then
echo "apxs exists"
echo "Checking if libcurl exists....."
CURL_VERSION=$(curl-config --version 2> /dev/null)
if [ $? -eq 0 ]; then
echo "Libcurl version is $CURL_VERSION"
cp src/mod_amf.tmpl src/mod_amf.h
if ! run_apxs -c -a -i src/mod_amf.c -lcurl; then
echo "apxs failed to compile or install mod_amf with libcurl"
exit 1
fi
else
echo "Libcurl not found"
cp src/mod_amf.tmpl src/mod_amf.h
if ! run_apxs -c -a -i -Wc,-DAMF_NO_CURL_SUPPORT src/mod_amf.c; then
echo "apxs failed to compile or install mod_amf"
exit 1
fi
echo "Remember you must manually update the rule files packaged with AMFPlus:"
echo
echo "AMFmobile from litemobiledetectionPlus.config file"
echo
echo "AMFtouch from litetouchdetectionPlus.config file"
echo
echo "AMFtablet from litetabletdetectionPlus.config file"
echo
echo "AMFtv from litetvdetectionPlus.config file"
echo
echo "AMFconsole from liteconsoledetectionPlus.config file"
echo
echo "AMFsettopbox from litesettopboxdetectionPlus.config file"
echo
echo "AMFereader from liteereaderdetectionPlus.config file"
echo
echo "AMFautomotive from liteautomotivedetectionPlus.config file"
echo
echo "AMFwearable from litewearabledetectionPlus.config file"
echo
echo "AMFbot from litebotdetectionPlus.config file"
echo
echo "If you don't want to manually configure it, install libcurl from https://curl.haxx.se/libcurl/ and rerun the AMF installation script. Add AMFDownloadParam on to your httpd.conf only when you explicitly want AMF to refresh rule files."
echo
fi
var=1
else
echo "File does not exist: $apxs"
echo "Please try again!"
echo
var=0
fi
echo "Remember to update your httpd.conf with the AMFHome parameter:"
echo "AMFHome /your/preferred/path/to/amf/config/files"
done