updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / groupvpn / groupvpn.patch
blob4ad971eeafcc791352d5186e7866fb072471b553
1 diff -Nur acisp2p.orig/bin/crawl.py acisp2p/bin/crawl.py
2 --- acisp2p.orig/bin/crawl.py 2011-06-02 06:44:15.000000000 +0600
3 +++ acisp2p/bin/crawl.py 2011-07-26 05:51:39.194636894 +0600
4 @@ -2,7 +2,7 @@
5 import xmlrpclib, sys, time, thread, types, getopt, pybru
7 usage = """usage:
8 -python crawl.py [--debug] [--port=<int>] [--namespace=<string>]
9 +python2 crawl.py [--debug] [--port=<int>] [--namespace=<string>]
10 debug = print the current node crawling
11 port = the xmlrpc port for a brunet node to be used for crawling
12 namespace = the brunet namespace to crawl
13 diff -Nur acisp2p.orig/bin/dump_dht_proxy.py acisp2p/bin/dump_dht_proxy.py
14 --- acisp2p.orig/bin/dump_dht_proxy.py 2011-06-02 06:44:15.000000000 +0600
15 +++ acisp2p/bin/dump_dht_proxy.py 2011-07-26 05:51:39.197970180 +0600
16 @@ -1,4 +1,4 @@
17 -#!/usr/bin/python
18 +#!/usr/bin/python2
19 import xmlrpclib, pickle, sys, socket
21 rpc = xmlrpclib.Server("http://127.0.0.1:10000/xm.rem")
22 diff -Nur acisp2p.orig/bin/groupvpn_bootstrap.sh acisp2p/bin/groupvpn_bootstrap.sh
23 --- acisp2p.orig/bin/groupvpn_bootstrap.sh 2011-06-02 06:44:15.000000000 +0600
24 +++ acisp2p/bin/groupvpn_bootstrap.sh 2011-07-26 05:51:39.197970180 +0600
25 @@ -1,5 +1,7 @@
26 #!/bin/bash
27 -source /etc/ipop.vpn.config
28 +. /etc/rc.conf
29 +. /etc/rc.d/functions
30 +. /etc/ipop.vpn.config
32 function get_pid()
34 @@ -16,7 +18,7 @@
36 function stop()
38 - echo "Stopping IPOP Bootstrap..."
39 + stat_busy "Stopping IPOP Bootstrap"
41 pid=`get_pid P2PNode.exe`
43 @@ -29,18 +31,18 @@
44 done
47 - echo "Stopped IPOP Bootstrap..."
48 + stat_done
51 function start()
53 pid=`get_pid P2PNode.exe`
54 if [[ $pid ]]; then
55 - echo "IPOP Bootstrap Already running..."
56 + echo "IPOP Bootstrap Already running"
57 return 1
60 - echo "Starting IPOP Bootstrap..."
61 + stat_busy "Starting IPOP Bootstrap"
63 if [[ "$USER" ]]; then
64 chown -R $USER $DIR/etc
65 @@ -55,7 +57,7 @@
66 cd $DIR/bin &> /dev/null
67 export MONO_PATH=$MONO_PATH:$DIR/lib
68 #trace is only enabled to help find bugs, to use it execute groupvpn.sh trace
69 - python daemon.py $user $group "mono --trace=disabled P2PNode.exe -c 10 -n $DIR/etc/bootstrap.config 2>&1 | cronolog --period=\"1 day\" --symlink=$DIR/var/bootstraplog $DIR/var/bootstrap.log.%y%m%d"
70 + python2 daemon.py $user $group "mono --trace=disabled P2PNode.exe -c 10 -n $DIR/etc/bootstrap.config 2>&1 | cronolog --period=\"1 day\" --symlink=$DIR/var/bootstraplog $DIR/var/bootstrap.log.%y%m%d"
71 cd - &> /dev/null
72 pid=`get_pid P2PNode.exe`
73 if [[ ! $pid ]]; then
74 @@ -64,13 +66,14 @@
77 if [[ ! $pid ]]; then
78 + stat_fail
79 echo "Error starting IPOP Bootstrap!"
80 exit
83 # setup logging
84 ln -sf $DIR/var/ipoplog /var/log/ipop
85 - echo "Started IPOP Bootstrap..."
86 + stat_done
89 case "$1" in
90 diff -Nur acisp2p.orig/bin/groupvpn.sh acisp2p/bin/groupvpn.sh
91 --- acisp2p.orig/bin/groupvpn.sh 2011-06-02 06:44:15.000000000 +0600
92 +++ acisp2p/bin/groupvpn.sh 2011-07-26 06:26:08.879334300 +0600
93 @@ -1,5 +1,9 @@
94 #!/bin/bash
95 -source /etc/ipop.vpn.config
96 +. /etc/rc.conf
97 +. /etc/rc.d/functions
98 +. /etc/ipop.vpn.config
100 +daemon_name=groupvpn
102 function get_pid()
104 @@ -16,9 +20,9 @@
106 function stop()
108 - echo "Stopping IPOP..."
109 + stat_busy "Stopping IPOP"
111 - dhcp_pid=$(get_pid tapipop)
112 + dhcp_pid=$(get_pid $DEVICE)
113 if [[ $dhcp_pid ]]; then
114 kill -KILL $dhcp_pid
116 @@ -40,20 +44,22 @@
117 done
120 - echo "Shutting off the TAP device"
121 - if [[ -e /proc/sys/net/ipv4/neigh/tapipop ]]; then
122 - tunctl -d tapipop 2>&1 | logger -t ipop
123 + #stat_busy "Shutting off the TAP device"
124 + if [[ -e /proc/sys/net/ipv4/neigh/$DEVICE ]]; then
125 + tunctl -d $DEVICE 2>&1 | logger -t ipop
128 - echo "Stopped IPOP..."
129 + rm_daemon $daemon_name
130 + stat_done
133 function start()
135 - echo "Starting IPOP..."
136 + stat_busy "Starting IPOP"
137 pid=$(get_pid DhtIpopNode.exe)
138 if [[ $pid ]]; then
139 - echo "IPOP Already running..."
140 + stat_fail
141 + echo "IPOP Already running"
142 return 1
145 @@ -86,15 +92,15 @@
146 chmod 666 /dev/net/tun
149 - if [[ ! -e /proc/sys/net/ipv4/neigh/tapipop ]]; then
150 + if [[ ! -e /proc/sys/net/ipv4/neigh/$DEVICE ]]; then
151 chmod 666 /dev/net/tun
152 - tunctl -t tapipop $tunctl_user &> /dev/null
153 + tunctl -t $DEVICE $tunctl_user &> /dev/null
156 cd $DIR/bin &> /dev/null
157 export MONO_PATH=$MONO_PATH:$DIR/lib
158 #trace is only enabled to help find bugs, to use it execute groupvpn.sh trace
159 - python daemon.py $user $group "mono --trace=disabled DhtIpopNode.exe -n $DIR/etc/node.config -i $DIR/etc/ipop.config -d $DIR/etc/dhcp.config 2>&1 | cronolog --period=\"1 day\" --symlink=$DIR/var/ipoplog $DIR/var/ipop.log.%y%m%d"
160 + python2 daemon.py $user $group "mono --trace=disabled DhtIpopNode.exe -n $DIR/etc/node.config -i $DIR/etc/ipop.config -d $DIR/etc/dhcp.config 2>&1 | cronolog --period=\"1 day\" --symlink=$DIR/var/ipoplog $DIR/var/ipop.log.%y%m%d"
161 cd - &> /dev/null
162 pid=$(get_pid DhtIpopNode.exe)
163 if [[ ! $pid ]]; then
164 @@ -103,6 +109,7 @@
167 if [[ ! $pid ]]; then
168 + stat_fail
169 echo "Error starting IPOP!"
170 exit
172 @@ -129,7 +136,7 @@
173 if [[ "$(which dhclient3 2> /dev/null)" ]]; then
174 DHCP="dhclient3 -pf /var/run/dhclient.$DEVICE.pid -lf /var/lib/dhcp3/dhclient.$DEVICE.leases $DEVICE"
175 elif [[ "$(which dhcpcd 2> /dev/null)" ]]; then
176 - DHCP="dhcpcd $DEVICE"
177 + DHCP="dhcpcd -t 0 -C resolv.conf -C hostname $DEVICE"
178 elif [[ "$(which dhclient 2> /dev/null)" ]]; then
179 DHCP="dhclient -nw -pf /var/run/dhclient.$DEVICE.pid -lf /var/lib/dhcp/dhclient.$DEVICE.leases $DEVICE"
180 else
181 @@ -142,7 +149,8 @@
183 # setup logging
184 ln -sf $DIR/var/ipoplog /var/log/ipop
185 - echo "Started IPOP..."
186 + add_daemon $daemon_name
187 + stat_done
190 case "$1" in
191 diff -Nur acisp2p.orig/bin/load_dht_proxy.py acisp2p/bin/load_dht_proxy.py
192 --- acisp2p.orig/bin/load_dht_proxy.py 2011-06-02 06:44:15.000000000 +0600
193 +++ acisp2p/bin/load_dht_proxy.py 2011-07-26 05:51:39.197970180 +0600
194 @@ -1,4 +1,4 @@
195 -#!/usr/bin/python
196 +#!/usr/bin/python2
197 import xmlrpclib, pickle, sys, socket
199 rpc = xmlrpclib.Server("http://127.0.0.1:10000/xm.rem")
200 diff -Nur acisp2p.orig/config/ipop.vpn.config acisp2p/config/ipop.vpn.config
201 --- acisp2p.orig/config/ipop.vpn.config 2011-06-02 06:43:58.000000000 +0600
202 +++ acisp2p/config/ipop.vpn.config 2011-07-26 05:51:39.197970180 +0600
203 @@ -1,6 +1,6 @@
204 #!/bin/bash
205 DEVICE="tapipop"
206 -DIR="/opt/ipop"
207 +DIR="/opt/groupvpn"
208 DHCP=
209 USER=
210 GROUP=
211 diff -Nur acisp2p.orig/install_arch.sh acisp2p/install_arch.sh
212 --- acisp2p.orig/install_arch.sh 2011-06-02 06:44:15.000000000 +0600
213 +++ acisp2p/install_arch.sh 2011-07-26 05:51:39.197970180 +0600
214 @@ -8,8 +8,8 @@
215 elif [[ ! -e `which cronolog 2> /dev/null` ]]; then
216 echo "Missing cronolog -- install cronolog"
217 exit
218 -elif [[ ! -e `which python 2> /dev/null` ]]; then
219 - echo "Missing python -- install python"
220 +elif [[ ! -e `which python2 2> /dev/null` ]]; then
221 + echo "Missing python2 -- install python-2.x"
222 exit