Contributed ppp-scripts
authorNLight Савченко В. М <admin@nlight.org.ua>
Sun, 6 Jan 2013 17:36:20 +0000 (19:36 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 21 Oct 2013 21:12:47 +0000 (23:12 +0200)
ppp-if.up-local [new file with mode: 0644]

diff --git a/ppp-if.up-local b/ppp-if.up-local
new file mode 100644 (file)
index 0000000..a4c9dff
--- /dev/null
@@ -0,0 +1,40 @@
+In /etc/ppp/
+
+1) find end edit "ip-up.local" or create it if not exists (else edit "ip-up" if .local is not supported, but not recommended)
+
+Put next:
+
+
+--BEGIN--
+#!/bin/bash
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+if [ "$(pidof udp-broadcast-relay)" ] 
+then
+  killall udp-broadcast-relay
+  echo "VPN client joined. Resetting UDP Broadcast Relay on port 6112"
+fi
+udp-broadcast-relay -f 1 6112 eth0 $(for i in $( ifconfig | grep 'ppp' | awk '{print $1}' ); do printf "$i "; done)
+exit 0
+--END--
+
+where 6112 is a port we are listening for the game broadcasts.
+
+
+2) find end edit "ip-down.local" or create it if not exists (else edit "ip-down" if .local is not supported, but not recommended)
+
+
+--BEGIN--
+#!/bin/bash
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+
+
+if [ "$(pidof udp-broadcast-relay)" ] 
+then
+  killall udp-broadcast-relay
+  echo "VPN client left. Resetting UDP Broadcast Relay on port 6112"
+  udp-broadcast-relay -f 1 6112 eth0 $(for i in $( ifconfig | grep 'ppp' | awk '{print $1}' ); do printf "$i "; done)
+fi
+exit 0
+--END--