From ea3fc005b978bf50f93749732deb636360dfaf23 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sat, 13 Oct 2012 23:03:00 +0000 Subject: [contrib/peer2anonet/peer2anonet] /service/$peer/run == symlink /etc/peer2anonet/peers/$peer/run; /service/$peer/run will now read from /etc/peer2anonet/peers/$peer/; more simple toggle for REMOTE_FLOAT --- contrib/peer2anonet/peer2anonet | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'contrib') 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 -- cgit v1.2.3