diff options
author | d3v11 <d3v11@d3v11.ano> | 2012-10-13 23:03:00 +0000 |
---|---|---|
committer | d3v11 <d3v11@d3v11.ano> | 2012-10-13 23:03:00 +0000 |
commit | ea3fc005b978bf50f93749732deb636360dfaf23 (patch) | |
tree | a3c6afbd10e45c45c6d1577ba70248d0b0c6c5b8 /contrib/peer2anonet | |
parent | b9c6d9b0318680a7a7b8bf773e396eae43a84ef2 (diff) | |
download | resdb-ea3fc005b978bf50f93749732deb636360dfaf23.tar.gz resdb-ea3fc005b978bf50f93749732deb636360dfaf23.zip |
[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
Diffstat (limited to 'contrib/peer2anonet')
-rwxr-xr-x | contrib/peer2anonet/peer2anonet | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet index 470ed67..bb91d71 100755 --- a/contrib/peer2anonet/peer2anonet +++ b/contrib/peer2anonet/peer2anonet @@ -236,16 +236,16 @@ protocol bgp $PEER { table AnoNet_routes; # #export REMOTE_FLOAT=1 -# comment if your peer has a dynamic IP -# -export REMOTE_ADDRESS=$REMOTEIP -export REMOTE_PORT=$PEERPORT +if [[ \$REMOTE_FLOAT != 1 ]]; then + export REMOTE_ADDRESS=\`cat /etc/peer2anonet/peers/$PEER/remote_ip\` + export REMOTE_PORT=\`cat /etc/peer2anonet/peers/$PEER/remote_port\` +fi # not recommended to change these values # -export LOCAL_PORT=$LOCALPORT -export PRIVATE_KEY=$SECKEY -export PUBLIC_KEY=$PUBKEY +export LOCAL_PORT=\`cat /etc/peer2anonet/peers/$PEER/local_port\` +export PRIVATE_KEY=\`cat /etc/peer2anonet/peers/$PEER/seckey\` +export PUBLIC_KEY=\`cat /etc/peer2anonet/peers/$PEER/pubkey\` export TUN_MODE=1 export INTERFACE=ppp-$PEER @@ -261,23 +261,23 @@ export INTERFACE=ppp-$PEER #route add \$REMOTE_ADDRESS gw \$DEFAULT_ROUTE ( sleep 5; - ip addr add $P2A_IP peer $PEERIP/32 dev \$INTERFACE scope link + ip addr add $P2A_IP peer \`cat /etc/peer2anonet/peers/$PEER/peering_ip\`/32 dev \$INTERFACE scope link ip addr add $P2A_ROUTE/32 dev \$INTERFACE scope global ip link set dev \$INTERFACE up # comment the following ping line to remove pinghack. this is a # trick used to help bird connect. # - ping -c 1 -I \$INTERFACE $PEERIP -r -w 5 + ping -c 1 -I \$INTERFACE \`cat /etc/peer2anonet/peers/$PEER/peering_ip\` -r -w 5 ) & exec /usr/sbin/quicktun.nacltai" > /etc/peer2anonet/peers/$PEER/run - cp /etc/peer2anonet/peers/$PEER/run /services/"$PEER"/run fi - chmod +x /services/"$PEER"/run + chmod +x /etc/peer2anonet/peers/"$PEER"/run + test -L /services/"$PEER"/run || rm -f /services/"$PEER"/run + test -L /services/"$PEER"/run || ln -s /etc/peer2anonet/peers/"$PEER"/run /services/"$PEER"/run + test -L "/service/$PEER" && svc -t "/service/$PEER" test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER" - sleep 1 - svc -d "/service/$PEER" ; svc -u "/service/$PEER" done test -L /service/bird || ln -s /services/bird /service/bird echo configure | birdc |