summaryrefslogtreecommitdiff
path: root/files/sbin/splash_sync
diff options
context:
space:
mode:
Diffstat (limited to 'files/sbin/splash_sync')
-rwxr-xr-xfiles/sbin/splash_sync43
1 files changed, 43 insertions, 0 deletions
diff --git a/files/sbin/splash_sync b/files/sbin/splash_sync
new file mode 100755
index 0000000..8299f97
--- /dev/null
+++ b/files/sbin/splash_sync
@@ -0,0 +1,43 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+x=0
+config_load splash_users
+test=1
+splash_check() {
+ timeout=6000
+ current_time=`date +%s`
+ config_get ip "$1" ip
+ config_get time "$1" time
+ local config="$1"
+ echo Vergleich Jetzt `date +%s` gespeichert $time
+ let time_check=$time+$timeout
+ if [ $time_check -gt $current_time ]; then
+ # User ist noch gesplashed
+ echo User ist noch gesplashed
+ iptables -t nat -D ffj_splash -s $ip -j ACCEPT
+ iptables -t nat -I ffj_splash 1 -s $ip -j ACCEPT
+ else
+ # User is not longer splashed / the user must click again
+ iptables -t nat -D ffj_splash -s $ip -j ACCPET
+ uci delete splash_users.@user[$x].ip
+ uci delete splash_users.@user[$x].time
+ uci delete splash_users.@user[$x]
+ uci commit
+ fi
+ let x=$x+1
+}
+#chain refresh
+iptables -t nat -D zone_mesh_prerouting -p tcp -j ffj_splash
+iptables -t nat -F ffj_splash
+iptables -t nat -X ffj_splash
+#recreation
+iptables -t nat -N ffj_splash
+iptables -t nat -I zone_mesh_prerouting 1 -p tcp -j ffj_splash
+config_foreach splash_check user
+#iptables -t nat -D ffj_splash -p tcp -j DNAT --to 10.17.200.1:80
+iptables -t nat -A ffj_splash -p tcp -j DNAT --to 10.17.200.1:80
+#iptables -t nat -D ffj_splash -j DROP
+#iptables -t nat -A ffj_splash -j DROP
+
+
+
contact: Jan Huwald // Impressum