Bob Mottram hace 9 años
padre
commit
d07212b118
Se han modificado 1 ficheros con 4 adiciones y 76 borrados
  1. 4
    76
      src/freedombone-image-customise

+ 4
- 76
src/freedombone-image-customise Ver fichero

@@ -651,83 +651,11 @@ function mesh_tox_node {
651 651
 	cd $rootdir$INSTALL_DIR/toxcore
652 652
 	git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
653 653
 
654
-	#chroot "$rootdir" cd $INSTALL_DIR/toxcore; autoreconf -i
655
-	#chroot "$rootdir" cd $INSTALL_DIR/toxcore; ./configure --enable-daemon --disable-av
656
-	#if [ ! "$?" = "0" ]; then
657
-		#return
658
-	#fi
659
-	#chroot "$rootdir" cd $INSTALL_DIR/toxcore; make
660
-	#if [ ! "$?" = "0" ]; then
661
-		#return
662
-	#fi
663
-	#chroot "$rootdir" cd $INSTALL_DIR/toxcore; make install
664
-	#chroot "$rootdir" cp /usr/local/lib/libtoxcore* /usr/lib/
665
-
666
-	#if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
667
-		#echo $"File not found /usr/local/bin/tox-bootstrapd"
668
-		#return
669
-	#fi
670
-
671
-	#chroot "$rootdir" useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment $"Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd
672
-	#chroot "$rootdir" chmod 700 /var/lib/tox-bootstrapd
673
-	#if [ ! -f $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then
674
-		#echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf"
675
-	#fi
676
-	# remove Maildir
677
-	#if [ -d $rootdir/var/lib/tox-bootstrapd/Maildir ]; then
678
-		#rm -rf $rootdir/var/lib/tox-bootstrapd/Maildir
679
-	#fi
680
-
681
-	# create configuration file
682
-	TOX_BOOTSTRAP_CONFIG=${rootdir}/etc/tox-bootstrapd.conf
683
-	echo "port = $TOX_PORT" > $TOX_BOOTSTRAP_CONFIG
684
-	echo 'keys_file_path = "/var/lib/tox-bootstrapd/keys"' >> $TOX_BOOTSTRAP_CONFIG
685
-	echo 'pid_file_path = "/var/run/tox-bootstrapd/tox-bootstrapd.pid"' >> $TOX_BOOTSTRAP_CONFIG
686
-	echo 'enable_ipv6 = true' >> $TOX_BOOTSTRAP_CONFIG
687
-	echo 'enable_ipv4_fallback = true' >> $TOX_BOOTSTRAP_CONFIG
688
-	echo 'enable_lan_discovery = true' >> $TOX_BOOTSTRAP_CONFIG
689
-	echo 'enable_tcp_relay = true' >> $TOX_BOOTSTRAP_CONFIG
690
-	echo "tcp_relay_ports = [443, 3389, $TOX_PORT]" >> $TOX_BOOTSTRAP_CONFIG
691
-	echo 'enable_motd = true' >> $TOX_BOOTSTRAP_CONFIG
692
-	echo 'motd = "tox-bootstrapd"' >> $TOX_BOOTSTRAP_CONFIG
693
-
694
-	if [ $TOX_NODES ]; then
695
-		echo 'bootstrap_nodes = (' >> $TOX_BOOTSTRAP_CONFIG
696
-		toxcount=0
697
-		while [ "x${TOX_NODES[toxcount]}" != "x" ]
698
-		do
699
-			toxval_ipv4=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $1}')
700
-			toxval_ipv6=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $2}')
701
-			toxval_port=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $3}')
702
-			toxval_pubkey=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $4}')
703
-			toxval_maintainer=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $5}')
704
-			echo "{ // $toxval_maintainer" >> $TOX_BOOTSTRAP_CONFIG
705
-			if [[ $toxval_ipv6 != 'NONE' ]]; then
706
-				echo "  address = \"$toxval_ipv6\"" >> $TOX_BOOTSTRAP_CONFIG
707
-			else
708
-				echo "  address = \"$toxval_ipv4\"" >> $TOX_BOOTSTRAP_CONFIG
709
-			fi
710
-			echo "  port = $toxval_port" >> $TOX_BOOTSTRAP_CONFIG
711
-			echo "  public_key = \"$toxval_pubkey\"" >> $TOX_BOOTSTRAP_CONFIG
712
-			toxcount=$(( $toxcount + 1 ))
713
-			if [ "x${TOX_NODES[toxcount]}" != "x" ]; then
714
-				echo "}," >> $TOX_BOOTSTRAP_CONFIG
715
-			else
716
-				echo "}" >> $TOX_BOOTSTRAP_CONFIG
717
-			fi
718
-		done
719
-		echo ')' >> $TOX_BOOTSTRAP_CONFIG
720
-	fi
721
-
722
-	if [ ! -f $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
723
-		echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
724
-		return
654
+	if ! grep -q "Toxcore commit" $rootdir$COMPLETION_FILE; then
655
+		echo "Toxcore commit:$TOXCORE_COMMIT" >> $rootdir$COMPLETION_FILE
656
+	else
657
+		sed -i "s|Toxcore commit.*|Toxcore commit:$TOXCORE_COMMIT|g" $rootdir$COMPLETION_FILE
725 658
 	fi
726
-	cp $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
727
-	sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
728
-
729
-	chroot "$rootdir" systemctl daemon-reload
730
-	chroot "$rootdir" systemctl enable tox-bootstrapd.service
731 659
 }
732 660
 
733 661
 function mesh_tox_client {