summaryrefslogtreecommitdiff
path: root/ppp-if.up-local
blob: a4c9dff08ca91eb0bc9e23b510f6bc272119a4bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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--