Mercurial > hg > anonet-resdb
annotate contrib/peer2anonet/peer2anonet @ 1048:c3e4b6c83537 draft
[scripts/git-config] change <name> <email>
author | d3v11 <d3v11@d3v11.ano> |
---|---|
date | Tue, 30 Oct 2012 05:48:41 +0000 |
parents | b211722679fb |
children | 5ec278277aa4 |
rev | line source |
---|---|
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
1 #!/bin/bash |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
2 if [[ $(id -u) != 0 ]]; then |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
3 echo "peer2anonet: root privileges required." |
771 | 4 exit 1 |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
5 fi |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
6 |
777 | 7 if [ -e /services/bird ]; then |
797 | 8 [ -e /etc/peer2anonet/bird.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/bird.tar backup" ;\ |
796 | 9 tar cf /etc/peer2anonet/bird.tar bird ) |
777 | 10 fi |
11 | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
12 [ -e contrib/peer2anonet/peer2anonet ] || echo "peer2anonet: not in \$RESDB_ROOT" |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
13 [ -e contrib/peer2anonet/peer2anonet ] || exit 1 |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
14 |
884 | 15 [ -w /etc/rc.local ] && chmod +x /etc/rc.local |
16 [ -w /etc/rc.d/rc.local ] && chmod +x /etc/rc.d/rc.local | |
17 | |
771 | 18 USAGE(){ |
19 echo -e '\npeer2anonet:' | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
20 echo -e '\n ./contrib/peer2anonet/peer2anonet --configure generate a new local configuration and exit' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
21 echo -e '\n ./contrib/peer2anonet/peer2anonet --update regenerate peer configurations' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
22 echo -e '\n ./contrib/peer2anonet/peer2anonet --configure-peer generate a new peer configuration and update' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
23 echo -e '\n ./contrib/peer2anonet/peer2anonet --rm-peer remove a peer configuration and update' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
24 echo -e '\n ./contrib/peer2anonet/peer2anonet --install-daemontools installs daemontools' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
25 echo -e '\n ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp installs ucspi-tcp' |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
26 echo -e '\n ./contrib/peer2anonet/peer2anonet --install-djbdns installs djbdns' |
870
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
27 echo -e '\n ./contrib/peer2anonet/peer2anonet --install-nacl installs nacl' |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
28 echo -e '\n ./contrib/peer2anonet/peer2anonet --setup-qmail installs and configures qmail' |
804 | 29 echo -e '\n ./contrib/peer2anonet/peer2anonet --configure-dns configures dnscache and tinydns zones' |
30 echo -e '\n ./contrib/peer2anonet/peer2anonet --update-dns updates tinydns-ano zone\n' | |
771 | 31 exit 0 |
32 } | |
550
4964136d5043
peer2anonet: added configuration on install to create env variables. see README for details.
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
549
diff
changeset
|
33 |
771 | 34 mkdir -p /service |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
35 mkdir -p /services |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
36 mkdir -p /services/bird |
771 | 37 mkdir -p /etc/peer2anonet |
38 mkdir -p /etc/peer2anonet/peers | |
537
8e8a01a680b4
peer2anonet changes made:
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
535
diff
changeset
|
39 |
771 | 40 CONFIGURE(){ |
41 echo -e '\nCONFIGURE:\n' | |
42 read -p " Enter your AnoNet subnet: " P2A_NET | |
43 read -p " Enter your AnoNet router: " P2A_ROUTE | |
44 read -p " Enter your peering ip: " P2A_IP | |
45 read -p " Enter your AnoNet asn: " P2A_ASN | |
782 | 46 |
47 | |
771 | 48 echo "P2A_NET=\"$P2A_NET\"">/etc/peer2anonet/p2a.conf |
49 echo "P2A_ROUTE=\"$P2A_ROUTE\"">>/etc/peer2anonet/p2a.conf | |
50 echo "P2A_IP=\"$P2A_IP\"">>/etc/peer2anonet/p2a.conf | |
51 echo "P2A_ASN=\"$P2A_ASN\"">>/etc/peer2anonet/p2a.conf | |
52 echo -e '\npeer2anonet: configured\n' | |
782 | 53 |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
54 NICK=`cat conf/git_name` |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
55 ./scripts/add_as $P2A_ASN $NICK |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
56 ./scripts/add_ip $P2A_NET/24 $NICK |
875
1f90d90584a0
added db/usr/$NICK/git|email to --configure
d3v11 <d3v11@d3v11.ano>
parents:
871
diff
changeset
|
57 [ -e "db/usr/$NICK" ] || mkdir -p "db/usr/$NICK" |
1f90d90584a0
added db/usr/$NICK/git|email to --configure
d3v11 <d3v11@d3v11.ano>
parents:
871
diff
changeset
|
58 [ -e "db/usr/$NICK/git" ] || echo "git://git.$NICK.ano/">"db/usr/$NICK/git" |
1f90d90584a0
added db/usr/$NICK/git|email to --configure
d3v11 <d3v11@d3v11.ano>
parents:
871
diff
changeset
|
59 [ -e "db/usr/$NICK/email" ] || echo "`cat conf/git_email`">"db/usr/$NICK/email" |
771 | 60 exit 0 |
61 } | |
62 | |
63 UPDATE(){ | |
782 | 64 if [ -e /etc/peer2anonet/p2a.conf ]; then |
65 source /etc/peer2anonet/p2a.conf | |
66 else | |
67 CONFIGURE | |
68 exit 0 | |
69 fi | |
70 | |
771 | 71 echo -e '\nUPDATE:\n' |
72 if [[ $(ls /etc/peer2anonet/peers) ]]; then | |
73 for PEER in `ls /etc/peer2anonet/peers`; do | |
74 if [ -e /etc/peer2anonet/peers/"$PEER"/remote_ip ]; then | |
75 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/remote_ip`) == 'X' ]]; then | |
797 | 76 echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_ip is void" |
771 | 77 exit 1 |
78 fi | |
79 else | |
797 | 80 echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_ip not exists" |
771 | 81 exit 1 |
82 fi | |
83 | |
84 if [ -e /etc/peer2anonet/peers/"$PEER"/peering_ip ]; then | |
85 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/peering_ip`) == 'X' ]]; then | |
797 | 86 echo " fatal error: /etc/peer2anonet/peers/$PEER/peering_ip is void" |
771 | 87 exit 1 |
88 fi | |
89 else | |
797 | 90 echo " fatal error: /etc/peer2anonet/peers/$PEER/peering_ip not exists" |
771 | 91 exit 1 |
92 fi | |
583
f5ec84b7d825
restored old resdb from srn and added new changes for tinydns, my git domain, and peer2anonet
d3v11 <d3v11@d3v11.ano>
parents:
559
diff
changeset
|
93 |
803
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
94 if [ -e /etc/peer2anonet/peers/"$PEER"/remote_port ]; then |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
95 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/remote_port`) == 'X' ]]; then |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
96 echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_port is void" |
771 | 97 exit 1 |
98 fi | |
99 else | |
803
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
100 echo " fatal error: /etc/peer2anonet/peers/$PEER/remote_port not exists" |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
101 exit 1 |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
102 fi |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
103 |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
104 if [ -e /etc/peer2anonet/peers/"$PEER"/local_port ]; then |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
105 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/local_port`) == 'X' ]]; then |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
106 echo " fatal error: /etc/peer2anonet/peers/$PEER/local_port is void" |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
107 exit 1 |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
108 fi |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
109 else |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
110 echo " fatal error: /etc/peer2anonet/peers/$PEER/local_port not exists" |
771 | 111 exit 1 |
112 fi | |
113 | |
114 if [ -e /etc/peer2anonet/peers/"$PEER"/asn ]; then | |
115 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/asn`) == 'X' ]]; then | |
797 | 116 echo " fatal error: /etc/peer2anonet/peers/$PEER/asn is void" |
771 | 117 exit 1 |
118 fi | |
119 else | |
797 | 120 echo " fatal error: /etc/peer2anonet/peers/$PEER/asn not exists" |
771 | 121 exit 1 |
122 fi | |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
123 |
771 | 124 if [ -e /etc/peer2anonet/peers/"$PEER"/pubkey ]; then |
125 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/pubkey`) == 'X' ]]; then | |
797 | 126 echo " fatal error: /etc/peer2anonet/peers/$PEER/pubkey is void" |
771 | 127 exit 1 |
128 fi | |
129 else | |
797 | 130 echo " fatal error: /etc/peer2anonet/peers/$PEER/pubkey not exists" |
771 | 131 exit 1 |
132 fi | |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
133 |
771 | 134 if [ -e /etc/peer2anonet/peers/"$PEER"/seckey ]; then |
135 if [[ $(echo X`cat /etc/peer2anonet/peers/"$PEER"/seckey`) == 'X' ]]; then | |
797 | 136 echo " fatal error: /etc/peer2anonet/peers/$PEER/seckey is void" |
771 | 137 exit 1 |
138 fi | |
139 else | |
797 | 140 echo " fatal error: /etc/peer2anonet/peers/$PEER/seckey not exists" |
771 | 141 exit 1 |
142 fi | |
143 done | |
144 else | |
797 | 145 echo " fatal error: peering configurations not exists" |
771 | 146 exit 1 |
147 fi | |
148 | |
149 echo '#!/bin/bash | |
150 bird -c bird.conf -d' > /services/bird/run | |
151 chmod +x /services/bird/run | |
152 | |
829
3750fcc21c33
updates to peer2anonet, added "static bird"
d3v11 <d3v11@d3v11.ano>
parents:
806
diff
changeset
|
153 if [ -e /etc/peer2anonet/bird.conf ]; then |
3750fcc21c33
updates to peer2anonet, added "static bird"
d3v11 <d3v11@d3v11.ano>
parents:
806
diff
changeset
|
154 cp /etc/peer2anonet/bird.conf /services/bird/bird.conf |
3750fcc21c33
updates to peer2anonet, added "static bird"
d3v11 <d3v11@d3v11.ano>
parents:
806
diff
changeset
|
155 else |
3750fcc21c33
updates to peer2anonet, added "static bird"
d3v11 <d3v11@d3v11.ano>
parents:
806
diff
changeset
|
156 echo "function n_AnoNet_mine (prefix arg) { |
550
4964136d5043
peer2anonet: added configuration on install to create env variables. see README for details.
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
549
diff
changeset
|
157 if arg ~ [ $P2A_NET/24+ ] then return true; |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
158 return false; }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
159 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
160 function n_AnoNet (prefix arg) { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
161 if arg ~ [ 1.0.0.0/8+ ] then return true; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
162 return false; }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
163 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
164 filter only_AnoNet_ebgp { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
165 if n_AnoNet(net) then |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
166 if !n_AnoNet_mine(net) then |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
167 accept \"AnoNet\"; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
168 else reject \"mine\"; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
169 reject \"non-AnoNet\"; }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
170 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
171 filter only_AnoNet_ebgp_export { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
172 if n_AnoNet(net) then accept \"AnoNet\"; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
173 reject \"non-AnoNet\"; }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
174 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
175 filter only_AnoNet { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
176 if n_AnoNet(net) then accept \"AnoNet\"; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
177 reject \"non-AnoNet\"; }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
178 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
179 table AnoNet_routes; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
180 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
181 protocol pipe pipe_AnoNet_routes { peer table AnoNet_routes; mode transparent; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
182 import filter only_AnoNet; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
183 export filter only_AnoNet; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
184 }; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
185 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
186 protocol static static_AnoNet_routes { table AnoNet_routes; |
583
f5ec84b7d825
restored old resdb from srn and added new changes for tinydns, my git domain, and peer2anonet
d3v11 <d3v11@d3v11.ano>
parents:
559
diff
changeset
|
187 route $P2A_NET/24 drop; |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
188 } |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
189 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
190 protocol kernel { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
191 scan time 10; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
192 import all; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
193 export all; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
194 } |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
195 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
196 protocol device { |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
197 scan time 900; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
198 } |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
199 |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
200 protocol direct direct_AnoNet_routes { table AnoNet_routes; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
201 interface \"eth0\"; |
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
202 import filter only_AnoNet; |
771 | 203 }" > /services/bird/bird.conf |
829
3750fcc21c33
updates to peer2anonet, added "static bird"
d3v11 <d3v11@d3v11.ano>
parents:
806
diff
changeset
|
204 fi |
537
8e8a01a680b4
peer2anonet changes made:
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
535
diff
changeset
|
205 |
771 | 206 for PEER in `ls /etc/peer2anonet/peers`; do |
207 mkdir -p /services/"$PEER" | |
208 REMOTEIP=`cat /etc/peer2anonet/peers/"$PEER"/remote_ip` | |
209 PEERIP=`cat /etc/peer2anonet/peers/"$PEER"/peering_ip` | |
803
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
210 PEERPORT=`cat /etc/peer2anonet/peers/"$PEER"/remote_port` |
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
211 LOCALPORT=`cat /etc/peer2anonet/peers/"$PEER"/local_port` |
771 | 212 PEERASN=`cat /etc/peer2anonet/peers/"$PEER"/asn` |
213 PUBKEY=`cat /etc/peer2anonet/peers/"$PEER"/pubkey` | |
214 SECKEY=`cat /etc/peer2anonet/peers/"$PEER"/seckey` | |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
215 |
771 | 216 echo " |
772 | 217 protocol bgp $PEER { table AnoNet_routes; |
771 | 218 local as $P2A_ASN; |
219 neighbor $PEERIP as $PEERASN; | |
220 source address $P2A_IP; | |
221 import filter only_AnoNet_ebgp; | |
222 export filter only_AnoNet_ebgp_export; | |
223 }" >> /services/bird/bird.conf | |
537
8e8a01a680b4
peer2anonet changes made:
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
535
diff
changeset
|
224 |
772 | 225 if [ -e /etc/peer2anonet/peers/"$PEER"/run ]; then |
1032
b3f81bd4309d
[contrib/peer2anonet/peer2anonet] cp bugfix
d3v11 <d3v11@d3v11.ano>
parents:
1028
diff
changeset
|
226 test -L /services/"$PEER"/run || rm -f /services/"$PEER"/run |
b3f81bd4309d
[contrib/peer2anonet/peer2anonet] cp bugfix
d3v11 <d3v11@d3v11.ano>
parents:
1028
diff
changeset
|
227 test -L /services/"$PEER"/run || ln -s /etc/peer2anonet/peers/"$PEER"/run /services/"$PEER"/run |
772 | 228 else |
229 echo "#!/bin/bash | |
726 | 230 |
231 # uncomment for debugging. you'll need to use ./run to view output instead | |
232 # of svc -u /service/<peer name> | |
233 # | |
234 #export DEBUG=1 | |
235 | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
236 # uncomment if your peer has a dynamic IP |
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
237 # |
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
238 #export REMOTE_FLOAT=1 |
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
239 |
1028
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
240 if [[ \$REMOTE_FLOAT != 1 ]]; then |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
241 export REMOTE_ADDRESS=\`cat /etc/peer2anonet/peers/$PEER/remote_ip\` |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
242 export REMOTE_PORT=\`cat /etc/peer2anonet/peers/$PEER/remote_port\` |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
243 fi |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
244 |
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
245 # not recommended to change these values |
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
246 # |
1028
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
247 export LOCAL_PORT=\`cat /etc/peer2anonet/peers/$PEER/local_port\` |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
248 export PRIVATE_KEY=\`cat /etc/peer2anonet/peers/$PEER/seckey\` |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
249 export PUBLIC_KEY=\`cat /etc/peer2anonet/peers/$PEER/pubkey\` |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
250 export TUN_MODE=1 |
772 | 251 export INTERFACE=ppp-$PEER |
726 | 252 |
253 # uncomment if you want to nuke your default gateway and configure | |
254 # routes only to peers through IcannNet. If any of your peers use | |
255 # dynamic IP's or you use Tor or i2p then this is probably NOT a | |
727
3138e320dc47
Peer2AnoNet updated: made changes to ./run configuration and included
d3v11 <d3v11@d3v11.ano>
parents:
726
diff
changeset
|
256 # good idea. You may need to modify the DEFAULT_ROUTE code below. |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
257 # If you run into problems with this please /msg /relayhell/d3v11 |
727
3138e320dc47
Peer2AnoNet updated: made changes to ./run configuration and included
d3v11 <d3v11@d3v11.ano>
parents:
726
diff
changeset
|
258 # so I can create a patch. |
726 | 259 # |
729
e8d1fe231dc3
peer2anonet bug(s) fixed with new /service*/<peername>/run configurations
d3v11 <d3v11@d3v11.ano>
parents:
728
diff
changeset
|
260 #DEFAULT_ROUTE=\`ip route show | grep default | cut -d' ' -f 3\` |
e8d1fe231dc3
peer2anonet bug(s) fixed with new /service*/<peername>/run configurations
d3v11 <d3v11@d3v11.ano>
parents:
728
diff
changeset
|
261 #route del default gw \$DEFAULT_ROUTE |
e8d1fe231dc3
peer2anonet bug(s) fixed with new /service*/<peername>/run configurations
d3v11 <d3v11@d3v11.ano>
parents:
728
diff
changeset
|
262 #route add \$REMOTE_ADDRESS gw \$DEFAULT_ROUTE |
726 | 263 |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
264 ( sleep 5; |
1028
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
265 ip addr add $P2A_IP peer \`cat /etc/peer2anonet/peers/$PEER/peering_ip\`/32 dev \$INTERFACE scope link |
550
4964136d5043
peer2anonet: added configuration on install to create env variables. see README for details.
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
549
diff
changeset
|
266 ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
267 ip link set dev \$INTERFACE up |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
268 |
731 | 269 # comment the following ping line to remove pinghack. this is a |
270 # trick used to help bird connect. | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
271 # |
1028
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
272 ping -c 1 -I \$INTERFACE \`cat /etc/peer2anonet/peers/$PEER/peering_ip\` -r -w 5 |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
273 |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
274 ) & |
772 | 275 exec /usr/sbin/quicktun.nacltai" > /etc/peer2anonet/peers/$PEER/run |
276 fi | |
1028
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
277 chmod +x /etc/peer2anonet/peers/"$PEER"/run |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
278 test -L /services/"$PEER"/run || rm -f /services/"$PEER"/run |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
279 test -L /services/"$PEER"/run || ln -s /etc/peer2anonet/peers/"$PEER"/run /services/"$PEER"/run |
8e301584fd93
[contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/<env files>; more simple toggle for REMOTE_FLOAT
d3v11 <d3v11@d3v11.ano>
parents:
1027
diff
changeset
|
280 test -L "/service/$PEER" && svc -t "/service/$PEER" |
772 | 281 test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER" |
771 | 282 done |
283 test -L /service/bird || ln -s /services/bird /service/bird | |
284 echo configure | birdc | |
285 } | |
286 | |
287 CONFIGURE_PEER(){ | |
782 | 288 if [ -e /etc/peer2anonet/p2a.conf ]; then |
289 source /etc/peer2anonet/p2a.conf | |
290 else | |
291 CONFIGURE | |
292 exit 0 | |
293 fi | |
294 | |
771 | 295 echo -e '\nCONFIGURE PEER:\n' |
772 | 296 read -p " Enter your peer's name: " PEER |
771 | 297 read -p " Enter your peer's remote ip: " REMOTEIP |
298 read -p " Enter your peer's peering ip: " PEERIP | |
299 read -p " Enter your peer's remote port: " PEERPORT | |
803
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
300 read -p " Enter your local port: " LOCALPORT |
771 | 301 read -p " Enter your peer's asn: " PEERASN |
302 read -p " Enter your peer's public key: " PUBKEY | |
303 read -p " Enter your private key: " SECKEY | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
304 [ -e /etc/peer2anonet/peers/"$PEER" ] && rm -r /etc/peer2anonet/peers/"$PEER" |
772 | 305 mkdir -p /etc/peer2anonet/peers/"$PEER" |
306 echo $REMOTEIP >/etc/peer2anonet/peers/"$PEER"/remote_ip | |
307 echo $PEERIP >/etc/peer2anonet/peers/"$PEER"/peering_ip | |
806
bdfcbc45bd9e
bugfix for peer2anonet --configure-peer
d3v11 <d3v11@d3v11.ano>
parents:
804
diff
changeset
|
308 echo $PEERPORT >/etc/peer2anonet/peers/"$PEER"/remote_port |
803
3761c3e87765
peer2anonet now asks for the local port
d3v11 <d3v11@d3v11.ano>
parents:
801
diff
changeset
|
309 echo $LOCALPORT >/etc/peer2anonet/peers/"$PEER"/local_port |
772 | 310 echo $PEERASN >/etc/peer2anonet/peers/"$PEER"/asn |
311 echo $PUBKEY >/etc/peer2anonet/peers/"$PEER"/pubkey | |
312 echo $SECKEY >/etc/peer2anonet/peers/"$PEER"/seckey | |
313 echo -e "\n configured $PEER\n" | |
771 | 314 } |
535
5965e074d13a
added peer2anonet: autoconfig tool for easily setting up peering and bgp on anonet using quicktun, bird, and daemontools
d3v1150m471c <d3v11@d3v1150m471c.ano>
parents:
diff
changeset
|
315 |
771 | 316 RM_PEER(){ |
782 | 317 if [ -e /etc/peer2anonet/p2a.conf ]; then |
318 source /etc/peer2anonet/p2a.conf | |
319 else | |
320 CONFIGURE | |
321 exit 0 | |
322 fi | |
323 | |
771 | 324 echo -e '\nRM PEER:\n' |
772 | 325 read -p " Enter your peer's name: " PEER |
326 if [ -e /etc/peer2anonet/peers/"$PEER" ]; then | |
327 rm -r /etc/peer2anonet/peers/"$PEER" | |
771 | 328 echo |
772 | 329 echo -e " removed /etc/peer2anonet/peers/$PEER\n" |
771 | 330 else |
331 echo | |
797 | 332 echo -e " fatal error: /etc/peer2anonet/peers/$PEER not exists\n" |
771 | 333 exit 1 |
334 fi | |
335 } | |
625
ad10fd05ee0e
modified contrib/peer2anonet/peer2anonet
d3v11 <d3v11@d3v11.ano>
parents:
624
diff
changeset
|
336 |
773 | 337 INSTALL_DAEMONTOOLS(){ |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
338 echo -e '\nINSTALL DAEMONTOOLS:\n' |
797 | 339 [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' |
773 | 340 [[ $(echo X`which gcc`) == X ]] && exit 1 |
797 | 341 [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' |
773 | 342 [[ $(echo X`which make`) == X ]] && exit 1 |
882 | 343 |
344 if [ -w /etc/inittab ]; then : | |
345 elif [ -w /etc/rc.local ] && ! [ -w /etc/inittab ]; then | |
951
1ec03f851ccf
can use exec instead of csh for --install-daemontools. thanks AP :-)
d3v11 <d3v11@d3v11.ano>
parents:
908
diff
changeset
|
346 sed -i "s/exit 0/exec \/command\/svscanboot \&/" /etc/rc.local |
882 | 347 chmod +x /etc/rc.local |
348 else | |
349 echo ' fatal error: cannot create reliable startup' | |
350 exit 1 | |
351 fi | |
352 | |
773 | 353 mkdir -p /package |
354 chmod 1755 /package | |
355 cd /package | |
356 wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz | |
357 gunzip daemontools-0.76.tar | |
358 tar -xpf daemontools-0.76.tar | |
359 rm -f daemontools-0.76.tar | |
360 cd admin/daemontools-0.76 | |
361 sed -i 's/gcc/gcc -include errno.h/g' src/conf-cc | |
362 package/install | |
951
1ec03f851ccf
can use exec instead of csh for --install-daemontools. thanks AP :-)
d3v11 <d3v11@d3v11.ano>
parents:
908
diff
changeset
|
363 exec /command/svscanboot >/dev/null 2>&1 & |
773 | 364 } |
365 | |
775 | 366 INSTALL_UCSPI_TCP(){ |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
367 echo -e '\nINSTALL UCSPI-TCP:\n' |
797 | 368 [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' |
775 | 369 [[ $(echo X`which gcc`) == X ]] && exit 1 |
797 | 370 [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' |
775 | 371 [[ $(echo X`which make`) == X ]] && exit 1 |
372 cd /usr/local/src | |
373 wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz | |
374 gunzip ucspi-tcp-0.88.tar | |
375 tar -xf ucspi-tcp-0.88.tar | |
376 cd ucspi-tcp-0.88 | |
783
0c6f45e85a7d
peer2anonet ucspi-tcp conf-cc bug fix
d3v11 <d3v11@d3v11.ano>
parents:
782
diff
changeset
|
377 sed -i 's/gcc/gcc -include errno.h/g' conf-cc |
775 | 378 make |
379 make setup check | |
380 } | |
381 | |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
382 SETUP_QMAIL(){ |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
383 echo -e '\nSETUP QMAIL:\n' |
906 | 384 |
385 echo -e '\tWARN:\n' | |
386 echo -e '\tYou should patch or firewall off qmail from' | |
387 echo -e '\treaching IcannNet so someone cannot harvest' | |
388 echo -e '\tyour IP with the mailerdaemon response.' | |
389 | |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
390 [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
391 [[ $(echo X`which gcc`) == X ]] && exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
392 [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
393 [[ $(echo X`which make`) == X ]] && exit 1 |
903 | 394 [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp' |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
395 [[ $(echo X`which tcpserver`) == X ]] && exit 1 |
903 | 396 [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
397 [[ $(echo X`which svscanboot`) == X ]] && exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
398 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
399 NICK=`cat conf/git_name` || exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
400 MX_IP=`cat conf/gitd_ip` || exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
401 MX_DOMAIN="a.mx.$NICK.ano" || exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
402 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
403 if [ -e /services/tinydns ]; then |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
404 ( |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
405 cd /services |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
406 echo "creating /etc/peer2anonet/tinydns.tar backup" |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
407 tar cf /etc/peer2anonet/tinydns.tar tinydns |
904 | 408 echo "@$NICK.ano:$MX_IP:a:12801:86400">>/services/tinydns/root/data |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
409 ) |
904 | 410 else |
905 | 411 echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --configure-dns' |
904 | 412 exit 1 |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
413 fi |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
414 |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
415 ( |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
416 cd /services/tinydns/root |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
417 make |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
418 cd /service |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
419 sleep 5 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
420 svc -t dnscache tinydns tinydns-ano tinydns-root |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
421 ) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
422 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
423 useradd qmaillog || exit 1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
424 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
425 if [ -w /etc/rc.local ]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
426 if [[ $(cat /etc/rc.local) != *"ip addr add $MX_IP/32 dev lo &"* ]]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
427 echo "ip addr add $MX_IP/32 dev lo &" >> /etc/rc.local |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
428 fi |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
429 elif [ -w /etc/rc.d/rc.local ]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
430 if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $MX_IP/32 dev lo &"* ]]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
431 echo "ip addr add $MX_IP/32 dev lo &" >> /etc/rc.d/rc.local |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
432 fi |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
433 else |
1042 | 434 ( |
435 mkdir -p /services/qmail-ips | |
436 echo "#!/bin/sh -e" > /services/qmail-ips/run | |
437 echo "ip addr add $MX_IP/32 dev lo &" >> /services/qmail-ips/run | |
438 echo "svc -d ." /services/qmail-ips/run | |
439 chmod +x /services/qmail-ips/run | |
440 test -L /service/qmail-ips || ln -s /services/qmail-ips /service/qmail-ips | |
441 ) | |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
442 fi |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
443 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
444 ip addr add $MX_IP/32 dev lo > /dev/null 2>&1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
445 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
446 if [ -e '/var/qmail/bin/qmail-qmtpd' ] || ! [ -e '/var/qmail/bin/qmail-smtpd' ]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
447 cd /usr/local/src |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
448 wget http://www.srn.ano/software/qmail-1.03.tar.gz |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
449 tar xzf qmail-1.03.tgz |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
450 cd qmail-1.03 |
901
c678f1f6a7e3
added documentation for --setup-qmail and fixed autoinstaller
d3v11 <d3v11@d3v11.ano>
parents:
900
diff
changeset
|
451 unset http_proxy |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
452 wget -O- http://www.srn.ano/patches/qmail-1.03-qmtpc.patch | patch -p1 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
453 mkdir /var/qmail |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
454 groupadd nofiles |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
455 useradd -g nofiles -d /var/qmail/alias alias |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
456 useradd -g nofiles -d /var/qmail qmaild |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
457 useradd -g nofiles -d /var/qmail qmaill |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
458 useradd -g nofiles -d /var/qmail qmailp |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
459 groupadd qmail |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
460 useradd -g qmail -d /var/qmail qmailq |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
461 useradd -g qmail -d /var/qmail qmailr |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
462 useradd -g qmail -d /var/qmail qmails |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
463 sed -i 's/gcc/gcc -include errno.h/g' conf-cc |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
464 make setup check |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
465 ./config-fast $MX_DOMAIN |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
466 echo yourdomain.ano >>/var/qmail/control/locals |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
467 echo yourdomain.ano >>/var/qmail/control/rcpthosts |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
468 (cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
469 chmod 644 ~alias/.qmail* |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
470 fi |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
471 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
472 mkdir -p /services/qmail |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
473 mkdir -p /services/qmail/log |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
474 mkdir -p /services/qmail/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
475 chown qmaillog /services/qmail/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
476 echo -e '#!/bin/sh\nexec env - PATH="/var/qmail/bin:/usr/local/bin:/usr/bin:/bin" qmail-start ./Mailbox' >/services/qmail/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
477 chmod +x /services/qmail/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
478 echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
479 chmod +x /services/qmail/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
480 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
481 ( cd / ; ln -s /services/qmail /service ) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
482 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
483 mkdir -p /services/qmail-smtpd |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
484 mkdir -p /services/qmail-smtpd/log |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
485 mkdir -p /services/qmail-smtpd/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
486 chown qmaillog /services/qmail-smtpd/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
487 echo -e echo -e '#!/bin/sh\nexec envuidgid qmaild tcpserver -U -c 100 '$MX_IP' smtp /var/qmail/bin/qmail-smtpd' >/services/qmail-smtpd/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
488 chmod +x /services/qmail-smtpd/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
489 echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail-smtpd/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
490 chmod +x /services/qmail-smtpd/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
491 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
492 ( cd / ; ln -s /services/qmail-smtpd /service ) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
493 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
494 mkdir -p /services/qmail-qmtpd |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
495 mkdir -p /services/qmail-qmtpd/log |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
496 mkdir -p /services/qmail-qmtpd/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
497 chown qmaillog /services/qmail-qmtpd/log/main |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
498 echo -e echo -e '#!/bin/sh\nexec envuidgid qmaild tcpserver -U -c 100 '$MX_IP' qmtp /var/qmail/bin/qmail-qmtpd' >/services/qmail-qmtpd/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
499 chmod +x /services/qmail-qmtpd/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
500 echo -e '#!/bin/sh\nexec setuidgid qmaillog multilog t s10000 n4 ./main' >/services/qmail-qmtpd/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
501 chmod +x /services/qmail-qmtpd/log/run |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
502 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
503 ( cd / ; ln -s /services/qmail-qmtpd /service ) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
504 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
505 ( |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
506 cd / |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
507 [ -e /usr/sbin/sendmail ] && mv /usr/sbin/sendmail /usr/sbin/sendmail.bak |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
508 ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
509 ) |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
510 |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
511 echo 'export MAIL=~/Mailbox' >>/etc/profile |
908 | 512 } |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
513 |
775 | 514 INSTALL_DJBDNS(){ |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
515 echo -e '\nINSTALL DJBDNS:\n' |
797 | 516 [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' |
775 | 517 [[ $(echo X`which gcc`) == X ]] && exit 1 |
797 | 518 [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' |
775 | 519 [[ $(echo X`which make`) == X ]] && exit 1 |
903 | 520 [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp' |
796 | 521 [[ $(echo X`which tcpserver`) == X ]] && exit 1 |
903 | 522 [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' |
797 | 523 [[ $(echo X`which svscanboot`) == X ]] && exit 1 |
775 | 524 cd /usr/local/src |
525 wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz | |
526 gunzip djbdns-1.05.tar | |
527 tar -xf djbdns-1.05.tar | |
528 cd djbdns-1.05 | |
529 echo gcc -O2 -include /usr/include/errno.h > conf-cc | |
530 make | |
531 make setup check | |
532 } | |
533 | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
534 CONFIGURE_DNS(){ |
782 | 535 if [ -e /etc/peer2anonet/p2a.conf ]; then |
536 source /etc/peer2anonet/p2a.conf | |
537 else | |
538 CONFIGURE | |
539 exit 0 | |
540 fi | |
541 | |
903 | 542 [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp' |
797 | 543 [[ $(echo X`which tcpserver`) == X ]] && exit 1 |
903 | 544 [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' |
797 | 545 [[ $(echo X`which svscanboot`) == X ]] && exit 1 |
1040
e267926631b6
[contrib/peer2anonet/peer2anonet] bugfix (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1032
diff
changeset
|
546 [[ $(echo X`which tinydns`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-djbdns' |
e267926631b6
[contrib/peer2anonet/peer2anonet] bugfix (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1032
diff
changeset
|
547 [[ $(echo X`which tinydns`) == X ]] && exit 1 |
797 | 548 |
796 | 549 if [ -e /services/dnscache ]; then |
550 [ -e /etc/peer2anonet/dnscache.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/dnscache.tar backup" ;\ | |
551 tar cf /etc/peer2anonet/dnscache.tar dnscache ) | |
552 fi | |
553 if [ -e /services/tinydns ]; then | |
554 [ -e /etc/peer2anonet/tinydns.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns.tar backup" ;\ | |
555 tar cf /etc/peer2anonet/tinydns.tar tinydns ) | |
556 fi | |
557 if [ -e /services/tinydns-ano ]; then | |
558 [ -e /etc/peer2anonet/tinydns-ano.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns-ano.tar backup" ;\ | |
559 tar cf /etc/peer2anonet/tinydns-ano.tar tinydns-ano ) | |
560 fi | |
561 if [ -e /services/tinydns-root ]; then | |
562 [ -e /etc/peer2anonet/tinydns-root.tar ] || ( cd /services ; echo "creating /etc/peer2anonet/tinydns-root.tar backup" ;\ | |
563 tar cf /etc/peer2anonet/tinydns-root.tar tinydns-root ) | |
564 fi | |
565 | |
804 | 566 ( |
567 cd /service | |
1041
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
568 svc -d dnscache tinydns tinydns-ano tinydns-root >/dev/null 2>&1 |
804 | 569 rm -f dnscache tinydns tinydns-ano tinydns-root |
570 cd /services | |
571 rm -rf dnscache tinydns tinydns-ano tinydns-root | |
572 ) | |
796 | 573 |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
574 echo -e '\nCONFIGURE DNS:\n' |
830
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
575 NICK=`cat conf/git_name` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
576 TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
577 TINYDNS_ROOT_DOMAIN=`cat conf/tinydns__rootsrvrname` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
578 TINYDNS_ANO_IP=`cat conf/tinydns__tldsrvrip` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
579 TINYDNS_ANO_DOMAIN=`cat conf/tinydns__tldsrvrname` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
580 TINYDNS_IP=`cat conf/tinydns__srvrip` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
581 TINYDNS_DOMAIN=`cat conf/tinydns__srvrname` || exit 1 |
8b706576b3f4
forced exit 1 for --configure-dns if someone didn't
d3v11 <d3v11@d3v11.ano>
parents:
829
diff
changeset
|
582 GIT_IP=`cat conf/gitd_ip` || exit 1 |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
583 GIT_DOMAIN="git.$NICK.ano" |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
584 |
885
4cf1f2c3e40f
added automatic addition of nameservers to resdb
d3v11 <d3v11@d3v11.ano>
parents:
884
diff
changeset
|
585 ./scripts/add_dom $NICK.ano $NICK $TINYDNS_DOMAIN/$TINYDNS_IP > /dev/null 2>&1 |
4cf1f2c3e40f
added automatic addition of nameservers to resdb
d3v11 <d3v11@d3v11.ano>
parents:
884
diff
changeset
|
586 |
883 | 587 if [ -w /etc/rc.local ]; then |
588 if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then | |
589 echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.local | |
590 fi | |
591 if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then | |
592 echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.local | |
593 fi | |
594 if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then | |
595 echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.local | |
596 fi | |
597 if [[ $(cat /etc/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then | |
598 echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.local | |
599 fi | |
600 elif [ -w /etc/rc.d/rc.local ]; then | |
601 if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then | |
602 echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.d/rc.local | |
603 fi | |
604 if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then | |
605 echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.d/rc.local | |
606 fi | |
607 if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then | |
608 echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.d/rc.local | |
609 fi | |
610 if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then | |
611 echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.d/rc.local | |
612 fi | |
613 else | |
1041
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
614 ( |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
615 mkdir -p /services/tinydns-ips |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
616 echo "#!/bin/sh -e" > /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
617 echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
618 echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
619 echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
620 echo "ip addr add $GIT_IP/32 dev lo &" >> /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
621 echo "svc -d ." /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
622 chmod +x /services/tinydns-ips/run |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
623 test -L /service/tinydns-ips || ln -s /services/tinydns-ips /service/tinydns-ips |
7d7befd08968
[peer2anonet] ip addr add (thanks talamon)
d3v11 <d3v11@d3v11.ano>
parents:
1040
diff
changeset
|
624 ) |
883 | 625 fi |
626 | |
798 | 627 ip addr add $TINYDNS_ROOT_IP/32 dev lo > /dev/null 2>&1 |
628 ip addr add $TINYDNS_IP/32 dev lo > /dev/null 2>&1 | |
629 ip addr add $TINYDNS_ANO_IP/32 dev lo > /dev/null 2>&1 | |
630 ip addr add $GIT_IP/32 dev lo > /dev/null 2>&1 | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
631 |
1042 | 632 useradd gdnscache |
633 useradd gdnslog | |
634 useradd gtinydns | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
635 |
1042 | 636 dnscache-conf gdnscache gdnslog /services/dnscache |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
637 mv /services/dnscache/root/servers/@ /services/dnscache/root/servers/@.icann |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
638 echo $TINYDNS_ROOT_IP >/services/dnscache/root/servers/@ |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
639 echo 'nameserver 127.0.0.1' >/etc/resolv.conf |
796 | 640 |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
641 |
1042 | 642 tinydns-conf gtinydns gdnslog /services/tinydns $TINYDNS_IP |
800 | 643 ( |
804 | 644 cd /services/tinydns/root |
645 ./add-ns $NICK.ano $TINYDNS_IP | |
646 ./add-alias $GIT_DOMAIN $GIT_IP | |
647 ./add-alias $TINYDNS_ROOT_DOMAIN $TINYDNS_ROOT_IP | |
648 ./add-alias $TINYDNS_ANO_DOMAIN $TINYDNS_ANO_IP | |
649 make | |
800 | 650 ) |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
651 |
1042 | 652 tinydns-conf gtinydns gdnslog /services/tinydns-root $TINYDNS_ROOT_IP |
796 | 653 ./scripts/nameserver_autogen/tinydns_root_datafile > /services/tinydns-root/root/data |
654 ( cd /services/tinydns-root/root ; make ) | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
655 |
1042 | 656 tinydns-conf gtinydns gdnslog /services/tinydns-ano $TINYDNS_ANO_IP |
796 | 657 ./scripts/nameserver_autogen/tinydns_tld_datafile > /services/tinydns-ano/root/data |
658 ( cd /services/tinydns-ano/root ; make ) | |
659 | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
660 ( |
804 | 661 cd / |
662 ln -s /services/dnscache /service/dnscache | |
663 ln -s /services/tinydns /service/tinydns | |
664 ln -s /services/tinydns-ano /service/tinydns-ano | |
665 ln -s /services/tinydns-root /service/tinydns-root | |
666 cd /service ; sleep 5 ; svc -t dnscache tinydns tinydns-ano tinydns-root | |
667 ) | |
668 } | |
669 | |
670 INSTALL_DJBDNS(){ | |
671 echo -e '\nINSTALL DJBDNS:\n' | |
672 [[ $(echo X`which gcc`) == X ]] && echo ' fatal error: cannot find gcc' | |
673 [[ $(echo X`which gcc`) == X ]] && exit 1 | |
674 [[ $(echo X`which make`) == X ]] && echo ' fatal error: cannot find make' | |
675 [[ $(echo X`which make`) == X ]] && exit 1 | |
903 | 676 [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp' |
804 | 677 [[ $(echo X`which tcpserver`) == X ]] && exit 1 |
903 | 678 [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' |
804 | 679 [[ $(echo X`which svscanboot`) == X ]] && exit 1 |
680 cd /usr/local/src | |
681 wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz | |
682 gunzip djbdns-1.05.tar | |
683 tar -xf djbdns-1.05.tar | |
684 cd djbdns-1.05 | |
685 echo gcc -O2 -include /usr/include/errno.h > conf-cc | |
686 make | |
687 make setup check | |
688 } | |
689 | |
690 UPDATE_DNS(){ | |
691 if [ -e /etc/peer2anonet/p2a.conf ]; then | |
692 source /etc/peer2anonet/p2a.conf | |
693 else | |
694 CONFIGURE | |
695 exit 0 | |
696 fi | |
697 | |
903 | 698 [[ $(echo X`which tcpserver`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-ucspi-tcp' |
804 | 699 [[ $(echo X`which tcpserver`) == X ]] && exit 1 |
903 | 700 [[ $(echo X`which svscanboot`) == X ]] && echo ' fatal error: needs ./contrib/peer2anonet/peer2anonet --install-daemontools' |
804 | 701 [[ $(echo X`which svscanboot`) == X ]] && exit 1 |
702 | |
703 if [ -e /services/tinydns-ano ]; then | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
704 ( |
804 | 705 cd /services |
706 echo "creating /etc/peer2anonet/tinydns-ano.tar backup" | |
707 tar cf /etc/peer2anonet/tinydns-ano.tar tinydns-ano | |
708 ) | |
709 fi | |
710 | |
711 echo -e '\nUPDATE DNS:\n' | |
712 ./scripts/nameserver_autogen/tinydns_tld_datafile > /services/tinydns-ano/root/data | |
713 ( cd /services/tinydns-ano/root ; make ) | |
714 | |
1027
8d9b9994d29d
[contrib/peer2anonet/peer2anonet] better comment instructions for dynamic peers
d3v11 <d3v11@d3v11.ano>
parents:
951
diff
changeset
|
715 ( |
804 | 716 cd /service |
717 sleep 5 | |
718 svc -t dnscache tinydns tinydns-ano tinydns-root | |
719 ) | |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
720 } |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
721 |
870
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
722 INSTALL_NACL(){ |
871 | 723 cd /usr/local/src |
870
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
724 wget http://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
725 bunzip2 < nacl-20110221.tar.bz2 | tar -xf - |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
726 cd nacl-20110221 |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
727 ./do |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
728 } |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
729 |
771 | 730 |
731 if [ "$1" == '--configure' ]; then | |
732 CONFIGURE | |
733 elif [ "$1" == '--update' ]; then | |
734 UPDATE | |
735 elif [ "$1" == '--configure-peer' ]; then | |
736 CONFIGURE_PEER | |
737 UPDATE | |
738 elif [ "$1" == '--rm-peer' ]; then | |
739 RM_PEER | |
740 UPDATE | |
775 | 741 elif [ "$1" == '--install-daemontools' ]; then |
779 | 742 INSTALL_DAEMONTOOLS |
775 | 743 elif [ "$1" == '--install-ucspi-tcp' ]; then |
744 INSTALL_UCSPI_TCP | |
745 elif [ "$1" == '--install-djbdns' ]; then | |
746 INSTALL_DJBDNS | |
870
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
747 elif [ "$1" == '--install-nacl' ]; then |
c99df9f8f1d1
./contrib/peer2anonet/peer2anonet --install-nacl
d3v11 <d3v11@d3v11.ano>
parents:
830
diff
changeset
|
748 INSTALL_NACL |
900
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
749 elif [ "$1" == '--setup-qmail' ]; then |
3d3031f8451d
added ./contrib/peer2anonet/peer2anonet --setup-qmail :-)
d3v11 <d3v11@d3v11.ano>
parents:
890
diff
changeset
|
750 SETUP_QMAIL |
778
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
751 elif [ "$1" == '--configure-dns' ]; then |
150043713880
massive update to peer2anonet, here's hoping i didn't fuck something
d3v11 <d3v11@d3v11.ano>
parents:
777
diff
changeset
|
752 CONFIGURE_DNS |
804 | 753 elif [ "$1" == '--update-dns' ]; then |
754 UPDATE_DNS | |
771 | 755 else |
756 USAGE | |
757 fi |