|  | 
 |  | 
 | 
												
													
														| 267 |  		return
 | 267 |  		return
 | 
												
													
														| 268 |  	fi
 | 268 |  	fi
 | 
												
													
														| 269 |  
 | 269 |  
 | 
												
													
														| 270 | -	${PROJECT_NAME}-mesh-install -f tox_node
 |  | 
 | 
												
													
														| 271 | -	if [ ! "$?" = "0" ]; then
 |  | 
 | 
												
													
														| 272 | -		echo $'Failed to install tox node'
 |  | 
 | 
												
													
														| 273 | -		exit 26778
 |  | 
 | 
												
													
														| 274 | -	fi
 |  | 
 | 
												
													
														|  | 
 | 270 | +	mesh_tox_node
 | 
												
													
														| 275 |  
 | 271 |  
 | 
												
													
														| 276 |  	TOX_ONION_HOSTNAME=$(add_onion_service tox ${TOX_PORT} ${TOX_PORT})
 | 272 |  	TOX_ONION_HOSTNAME=$(add_onion_service tox ${TOX_PORT} ${TOX_PORT})
 | 
												
													
														| 277 |  
 | 273 |  
 | 
												
											
												
													
														|  | 
 |  | 
 | 
												
													
														| 381 |  		exit 16865
 | 377 |  		exit 16865
 | 
												
													
														| 382 |  	fi
 | 378 |  	fi
 | 
												
													
														| 383 |  
 | 379 |  
 | 
												
													
														| 384 | -	chroot "$rootdir" apt-get -y install build-essential libtool autotools-dev
 |  | 
 | 
												
													
														| 385 | -	chroot "$rootdir" apt-get -y install automake checkinstall check git yasm
 |  | 
 | 
												
													
														| 386 | -	chroot "$rootdir" apt-get -y install libsodium13 libsodium-dev libcap2-bin
 |  | 
 | 
												
													
														| 387 | -	chroot "$rootdir" apt-get -y install libconfig9 libconfig-dev autoconf
 |  | 
 | 
												
													
														|  | 
 | 380 | +	mesh_tox_node_prefix=''
 | 
												
													
														|  | 
 | 381 | +	if [ $rootdir ]; then
 | 
												
													
														|  | 
 | 382 | +		mesh_tox_node_prefix="chroot \"$rootdir\""
 | 
												
													
														|  | 
 | 383 | +	fi
 | 
												
													
														|  | 
 | 384 | +	$mesh_tox_node_prefix apt-get -y install build-essential libtool autotools-dev
 | 
												
													
														|  | 
 | 385 | +	$mesh_tox_node_prefix apt-get -y install automake checkinstall check git yasm
 | 
												
													
														|  | 
 | 386 | +	$mesh_tox_node_prefix apt-get -y install libsodium13 libsodium-dev libcap2-bin
 | 
												
													
														|  | 
 | 387 | +	$mesh_tox_node_prefix apt-get -y install libconfig9 libconfig-dev autoconf
 | 
												
													
														| 388 |  
 | 388 |  
 | 
												
													
														| 389 |  	TEMP_SCRIPT_NAME=fbtmp37272.sh
 | 389 |  	TEMP_SCRIPT_NAME=fbtmp37272.sh
 | 
												
													
														| 390 |  	TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
 | 390 |  	TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
 | 
												
											
												
													
														|  | 
 |  | 
 | 
												
													
														| 397 |  	cd ${rootdir}$INSTALL_DIR/toxcore
 | 397 |  	cd ${rootdir}$INSTALL_DIR/toxcore
 | 
												
													
														| 398 |  	git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
 | 398 |  	git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
 | 
												
													
														| 399 |  
 | 399 |  
 | 
												
													
														| 400 | -	chroot "$rootdir" /bin/bash -x <<EOF
 |  | 
 | 
												
													
														|  | 
 | 400 | +	$mesh_tox_node_prefix /bin/bash -x <<EOF
 | 
												
													
														| 401 |  cd ${INSTALL_DIR}/toxcore
 | 401 |  cd ${INSTALL_DIR}/toxcore
 | 
												
													
														| 402 |  autoreconf -i
 | 402 |  autoreconf -i
 | 
												
													
														| 403 |  ./configure --enable-daemon --disable-av
 | 403 |  ./configure --enable-daemon --disable-av
 | 
												
											
												
													
														|  | 
 |  | 
 | 
												
													
														| 408 |  	cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
 | 408 |  	cp $rootdir/usr/local/lib/libtoxcore* $rootdir/usr/lib/
 | 
												
													
														| 409 |  	cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
 | 409 |  	cp ${rootdir}${INSTALL_DIR}/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
 | 
												
													
														| 410 |  	sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
 | 410 |  	sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
 | 
												
													
														| 411 | -	chroot "$rootdir" systemctl enable tox-bootstrapd.service
 |  | 
 | 
												
													
														|  | 
 | 411 | +	$mesh_tox_node_prefix systemctl enable tox-bootstrapd.service
 | 
												
													
														| 412 |  
 | 412 |  
 | 
												
													
														| 413 |  	SECONDS=0
 | 413 |  	SECONDS=0
 | 
												
													
														| 414 |  	if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
 | 414 |  	if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
 | 
												
											
												
													
														|  | 
 |  | 
 | 
												
													
														| 420 |  	duration=$SECONDS
 | 420 |  	duration=$SECONDS
 | 
												
													
														| 421 |  	echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
 | 421 |  	echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
 | 
												
													
														| 422 |  
 | 422 |  
 | 
												
													
														| 423 | -	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
 |  | 
 | 
												
													
														| 424 | -	chroot "$rootdir" chmod 700 /var/lib/tox-bootstrapd
 |  | 
 | 
												
													
														|  | 
 | 423 | +	$mesh_tox_node_prefix 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
 | 
												
													
														|  | 
 | 424 | +	$mesh_tox_node_prefix chmod 700 /var/lib/tox-bootstrapd
 | 
												
													
														| 425 |  
 | 425 |  
 | 
												
													
														| 426 |  	# remove Maildir
 | 426 |  	# remove Maildir
 | 
												
													
														| 427 |  	if [ -d $rootdir/var/lib/tox-bootstrapd/Maildir ]; then
 | 427 |  	if [ -d $rootdir/var/lib/tox-bootstrapd/Maildir ]; then
 |