diff options
author | Peter Johanson <latexer@gentoo.org> | 2003-06-10 15:24:58 +0000 |
---|---|---|
committer | Peter Johanson <latexer@gentoo.org> | 2003-06-10 15:24:58 +0000 |
commit | c194152501d5f16b42e88d38d6ece02f76560e53 (patch) | |
tree | a5df3d462e57568a455dfb4051a366a77f67b306 /net-misc/freenet6 | |
parent | added gentoo.sh. bug #21865 (diff) | |
download | gentoo-2-c194152501d5f16b42e88d38d6ece02f76560e53.tar.gz gentoo-2-c194152501d5f16b42e88d38d6ece02f76560e53.tar.bz2 gentoo-2-c194152501d5f16b42e88d38d6ece02f76560e53.zip |
added gentoo.sh. bug #21865
Diffstat (limited to 'net-misc/freenet6')
-rw-r--r-- | net-misc/freenet6/ChangeLog | 6 | ||||
-rw-r--r-- | net-misc/freenet6/Manifest | 4 | ||||
-rw-r--r-- | net-misc/freenet6/files/gentoo.sh | 166 | ||||
-rw-r--r-- | net-misc/freenet6/freenet6-0.9.7.ebuild | 3 |
4 files changed, 175 insertions, 4 deletions
diff --git a/net-misc/freenet6/ChangeLog b/net-misc/freenet6/ChangeLog index 6ef1c41629d8..7b4b7019f109 100644 --- a/net-misc/freenet6/ChangeLog +++ b/net-misc/freenet6/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-misc/freenet6 # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/freenet6/ChangeLog,v 1.1 2003/05/28 18:36:41 latexer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/freenet6/ChangeLog,v 1.2 2003/06/10 15:24:54 latexer Exp $ + + 10 Jun 2003; Peter Johanson <latexer@gentoo.org> freenet6-0.9.7.ebuild, + files/gentoo.sh: + Added a gentoo.sh script which matches gentoo's placement of things. bug #21865 *freenet6-0.9.7 (28 May 2003) diff --git a/net-misc/freenet6/Manifest b/net-misc/freenet6/Manifest index 6998c1f88304..b527045dd7c5 100644 --- a/net-misc/freenet6/Manifest +++ b/net-misc/freenet6/Manifest @@ -1,5 +1,5 @@ -MD5 3a0f435415eebe3b1ac01bf100f759e9 ChangeLog 411 -MD5 957bad91807111a8d496f33924d88b6a freenet6-0.9.7.ebuild 1342 +MD5 10d301c34fe3845d7cd8a3f51cecf4a0 ChangeLog 587 +MD5 f3f1a7d8faf022bc7b95356ac875b177 freenet6-0.9.7.ebuild 1342 MD5 7b3923fbb5cdc1bee32e08037ff62d08 files/freenet6-0.9.2.diff 4538 MD5 b9d2127ddd9f73a468979e10bba5e06b files/digest-freenet6-0.9.7 63 MD5 c3987cc58f033790cf60642d69481b93 files/tspc.rc 171 diff --git a/net-misc/freenet6/files/gentoo.sh b/net-misc/freenet6/files/gentoo.sh new file mode 100644 index 000000000000..3a8b2f2518d1 --- /dev/null +++ b/net-misc/freenet6/files/gentoo.sh @@ -0,0 +1,166 @@ +#!/bin/sh + +LANGUAGE=C + +if [ -z $TSP_VERBOSE ]; then + TSP_VERBOSE=0 +fi + +KillProcess() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo killing $* + fi + fi + PID=`ps axww | grep $1 | grep -v grep | awk '{ print $1;}'` + echo $PID + if [ ! -z $PID ]; then + kill $PID + fi +} + +Display() +{ + if [ -z $TSP_VERBOSE ]; then + return; + fi + if [ $TSP_VERBOSE -lt $1 ]; then + return; + fi + shift + echo "$*" +} + +Exec() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo $* + fi + fi + $* # Execute command + if [ $? -ne 0 ]; then + echo "Error while executing $1" + echo " Command: $*" + exit 1 + fi +} + +ExecNoCheck() +{ + if [ ! -z $TSP_VERBOSE ]; then + if [ $TSP_VERBOSE -ge 2 ]; then + echo $* + fi + fi + $* # Execute command +} + +# Program localization + +Display 1 "--- Start of configuration script. ---" +Display 1 "Script: " `basename $0` + +ifconfig=/sbin/ifconfig +route=/sbin/route +ipconfig=/sbin/ip +rtadvd=/usr/sbin/radvd +sysctl=/sbin/sysctl +rtadvdconfigfilename=radvd.conf +rtadvdconfigfile=/etc/radvd/$rtadvdconfigfilename + +if [ -z $TSP_HOME_DIR ]; then + echo "TSP_HOME_DIR variable not specified!;" + exit 1 +fi + +if [ ! -d $TSP_HOME_DIR ]; then + echo "Error : directory $TSP_HOME_DIR does not exist" + exit 1 +fi +# + +if [ -z $TSP_HOST_TYPE ]; then + echo Error: TSP_HOST_TYPE not defined. + exit 1 +fi + +#change to upper case +TSP_HOST_TYPE=`echo $TSP_HOST_TYPE | tr a-z A-Z` + +if [ X"${TSP_HOST_TYPE}" = X"HOST" ] || [ X"${TSP_HOST_TYPE}" = X"ROUTER" ]; then + # + # Configured tunnel config (IPv6) + + Display 1 "$TSP_TUNNEL_INTERFACE setup" + Display 1 "Setting up link to $TSP_SERVER_ADDRESS_IPV4" + if [ -x $ipconfig ]; then + Exec $ipconfig tunnel add $TSP_TUNNEL_INTERFACE mode sit ttl 64 remote $TSP_SERVER_ADDRESS_IPV4 + else + Exec $ifconfig $TSP_TUNNEL_INTERFACE tunnel ::$TSP_SERVER_ADDRESS_IPV4 + fi + + Exec $ifconfig $TSP_TUNNEL_INTERFACE up + + PREF=`echo $TSP_CLIENT_ADDRESS_IPV6 | sed "s/:0*/:/g" |cut -d : -f1-2` + OLDADDR=`$ifconfig $TSP_TUNNEL_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"` + if [ ! -z $OLDADDR ]; then + Display 1 "Removing old IPv6 address $OLDADDR" + Exec $ifconfig $TSP_TUNNEL_INTERFACE inet6 del $OLDADDR + fi + Display 1 "This host is: $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN" + Exec $ifconfig $TSP_TUNNEL_INTERFACE add $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN + + # + # Default route + Display 1 "Adding default route" + ExecNoCheck $route -A inet6 del ::/0 2>/dev/null # delete old default route + Exec $route -A inet6 add ::/0 dev $TSP_TUNNEL_INTERFACE + Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE +fi + +# Router configuration if required +if [ X"${TSP_HOST_TYPE}" = X"ROUTER" ]; then + Display 1 "Router configuration" + Display 1 "Kernel setup" + #Better way on linux to avoid loop with the remaining /48? + $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null + Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled + Display 1 "Adding prefix to $TSP_HOME_INTERFACE" + OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"` + if [ ! -z $OLDADDR ]; then + Display 1 "Removing old IPv6 address $OLDADDR" + Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR + fi + Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX:1::1/64 + # Router advertisement configuration + Display 1 "Create new $rtadvdconfigfile" + echo "##### radvd.conf made by TSP ####" > "$rtadvdconfigfile" + echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile" + echo "{" >> "$rtadvdconfigfile" + echo " AdvSendAdvert on;" >> "$rtadvdconfigfile" + echo " prefix $TSP_PREFIX:0001::/64" >> "$rtadvdconfigfile" + echo " {" >> "$rtadvdconfigfile" + echo " AdvOnLink on;" >> "$rtadvdconfigfile" + echo " AdvAutonomous on;" >> "$rtadvdconfigfile" + echo " AdvRouterAddr on;" >> "$rtadvdconfigfile" + echo " };" >> "$rtadvdconfigfile" + echo "};" >> "$rtadvdconfigfile" + echo "" >> "$rtadvdconfigfile" + if [ -f /var/run/radvd/radvd.pid ]; then + /etc/init.d/radvd stop + fi + if [ -f $rtadvdconfigfile ]; then + /etc/init.d/radvd start + else + echo "Error : file $rtadvdconfigfile not found" + exit 1 + fi +fi + +Display 1 "--- End of configuration script. ---" + +exit 0 + +#--------------------------------------------------------------------- diff --git a/net-misc/freenet6/freenet6-0.9.7.ebuild b/net-misc/freenet6/freenet6-0.9.7.ebuild index 2ad8f1c33638..f3fcce4062eb 100644 --- a/net-misc/freenet6/freenet6-0.9.7.ebuild +++ b/net-misc/freenet6/freenet6-0.9.7.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/freenet6/freenet6-0.9.7.ebuild,v 1.1 2003/05/28 18:36:41 latexer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/freenet6/freenet6-0.9.7.ebuild,v 1.2 2003/06/10 15:24:54 latexer Exp $ DESCRIPTION="Client to configure an IPv6 tunnel to freenet6" HOMEPAGE="http://www.freenet6.net/" @@ -34,6 +34,7 @@ src_install() { doins ${FILESDIR}/tspc.conf exeinto /etc/freenet6/template doexe template/{linux,checktunnel}.sh + doexe ${FILESDIR}/gentoo.sh dodoc CONTRIB.txt LEGAL LEGAL.html README doman man/{man5/tspc.conf.5,man8/tspc.8} |