Skip to content

Commit c5cf31a

Browse files
committed
www: merge stats and tools to '04-additional.sh'
1 parent 1039a99 commit c5cf31a

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

salt/freifunk/base/ddmesh/var/www_freifunk/05-tools.sh renamed to salt/freifunk/base/ddmesh/var/www_freifunk/04-additional.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
#!/usr/bin/env bash
2-
# Show Tools only for internal FFDD-Network clients
2+
# Show additional links only for internal FFDD-Network clients
33

44
# FFDD-Network
55
ALLOWED_IP="10.200.0.0/15"
66
# get REMOTE_ADDR from CGI ENV
77
IP="$REMOTE_ADDR"
88

9+
hostname_short="$(cat /etc/hostname | awk -F'.' '{print $1}')"
10+
911
check_cidr="/usr/bin/grepcidr $ALLOWED_IP <(echo $IP) >/dev/null"
1012
eval "$check_cidr"
1113

12-
hostname_short="$(cat /etc/hostname | awk -F'.' '{print $1}')"
13-
1414
# exclude network != FFDD-Network and NAT'ed Rules from ipX/nodeX.freifunk-dresden.de
1515
if [ "$?" -eq 0 ] && [ "$IP" != '10.200.0.1' ]; then
16+
# stats
17+
cat <<-EOM
18+
<TR><TD><BIG CLASS="plugin">Statistik</BIG></TD></TR>
19+
<TR><TD><DIV CLASS="plugin"><A CLASS="plugin" TARGET="_blank" HREF="/bind_stats">DNS Stats</A></DIV></TD></TR>
20+
<TR><TD><DIV CLASS="plugin"><A CLASS="plugin" TARGET="_blank" HREF="/monitorix">Monitorix</A></DIV></TD></TR>
21+
EOM
22+
23+
# tools
1624
if [ "$(uci -qX get ffdd.sys.apache_ddos_prevent)" -eq '0' ]; then
1725
cat <<-EOM
1826
<TR><TD><BIG CLASS="plugin">Tools</BIG></TD></TR>

salt/freifunk/base/ddmesh/var/www_freifunk/04-stats.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)