File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: enable GeoIP Awstats
3+ #
4+ # The function enables resolving IP addresses with the use of GeoIP database
5+
6+
7+ # ----------------------------------------------------------#
8+ # Variable&Function #
9+ # ----------------------------------------------------------#
10+
11+ # Includes
12+ source $HESTIA /func/main.sh
13+ source $HESTIA /conf/hestia.conf
14+
15+
16+ # ----------------------------------------------------------#
17+ # Verifications #
18+ # ----------------------------------------------------------#
19+
20+ # check if string already exists
21+ if grep " geoip" $HESTIA /data/templates/web/awstats/awstats.conf; then
22+ echo " Plugin allready enabled"
23+ exit 0
24+ fi
25+
26+ # ----------------------------------------------------------#
27+ # Action #
28+ # ----------------------------------------------------------#
29+
30+ if [ -d /etc/awstats ]; then
31+ perl -MCPAN -f -e " install Geo::IP::PurePerl"
32+ perl -MCPAN -f -e " install Geo::IP"
33+ sed -i ' /LoadPlugin=\"geoip GEOIP_STANDARD \/usr\/share\/GeoIP\/GeoIP.dat\"/s/^#//g' /etc/awstats.conf
34+ echo " LoadPlugin=\" geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat\" " >> $HESTIA /data/templates/web/awstats/awstats.conf
35+ $HESTIA /bin/v-update-web-templates " yes"
36+ fi
37+
38+ # ----------------------------------------------------------#
39+ # Hestia #
40+ # ----------------------------------------------------------#
41+
42+ # Logging
43+ log_history " Enabled GeoIP Awstats" ' ' ' admin'
44+ log_event " $OK " " $ARGUMENTS "
45+
46+ exit 0
You can’t perform that action at this time.
0 commit comments