Skip to content

Commit

Permalink
www: merge stats and tools to '04-additional.sh'
Browse files Browse the repository at this point in the history
  • Loading branch information
cremesk committed Nov 11, 2024
1 parent 1039a99 commit c5cf31a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#!/usr/bin/env bash
# Show Tools only for internal FFDD-Network clients
# Show additional links only for internal FFDD-Network clients

# FFDD-Network
ALLOWED_IP="10.200.0.0/15"
# get REMOTE_ADDR from CGI ENV
IP="$REMOTE_ADDR"

hostname_short="$(cat /etc/hostname | awk -F'.' '{print $1}')"

check_cidr="/usr/bin/grepcidr $ALLOWED_IP <(echo $IP) >/dev/null"
eval "$check_cidr"

hostname_short="$(cat /etc/hostname | awk -F'.' '{print $1}')"

# exclude network != FFDD-Network and NAT'ed Rules from ipX/nodeX.freifunk-dresden.de
if [ "$?" -eq 0 ] && [ "$IP" != '10.200.0.1' ]; then
# stats
cat <<-EOM
<TR><TD><BIG CLASS="plugin">Statistik</BIG></TD></TR>
<TR><TD><DIV CLASS="plugin"><A CLASS="plugin" TARGET="_blank" HREF="/bind_stats">DNS Stats</A></DIV></TD></TR>
<TR><TD><DIV CLASS="plugin"><A CLASS="plugin" TARGET="_blank" HREF="/monitorix">Monitorix</A></DIV></TD></TR>
EOM

# tools
if [ "$(uci -qX get ffdd.sys.apache_ddos_prevent)" -eq '0' ]; then
cat <<-EOM
<TR><TD><BIG CLASS="plugin">Tools</BIG></TD></TR>
Expand Down
19 changes: 0 additions & 19 deletions salt/freifunk/base/ddmesh/var/www_freifunk/04-stats.sh

This file was deleted.

0 comments on commit c5cf31a

Please sign in to comment.