Tidying
This commit is contained in:
parent
043862ec9a
commit
d07212b118
|
@ -651,83 +651,11 @@ function mesh_tox_node {
|
|||
cd $rootdir$INSTALL_DIR/toxcore
|
||||
git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT
|
||||
|
||||
#chroot "$rootdir" cd $INSTALL_DIR/toxcore; autoreconf -i
|
||||
#chroot "$rootdir" cd $INSTALL_DIR/toxcore; ./configure --enable-daemon --disable-av
|
||||
#if [ ! "$?" = "0" ]; then
|
||||
#return
|
||||
#fi
|
||||
#chroot "$rootdir" cd $INSTALL_DIR/toxcore; make
|
||||
#if [ ! "$?" = "0" ]; then
|
||||
#return
|
||||
#fi
|
||||
#chroot "$rootdir" cd $INSTALL_DIR/toxcore; make install
|
||||
#chroot "$rootdir" cp /usr/local/lib/libtoxcore* /usr/lib/
|
||||
|
||||
#if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
|
||||
#echo $"File not found /usr/local/bin/tox-bootstrapd"
|
||||
#return
|
||||
#fi
|
||||
|
||||
#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
|
||||
#chroot "$rootdir" chmod 700 /var/lib/tox-bootstrapd
|
||||
#if [ ! -f $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then
|
||||
#echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf"
|
||||
#fi
|
||||
# remove Maildir
|
||||
#if [ -d $rootdir/var/lib/tox-bootstrapd/Maildir ]; then
|
||||
#rm -rf $rootdir/var/lib/tox-bootstrapd/Maildir
|
||||
#fi
|
||||
|
||||
# create configuration file
|
||||
TOX_BOOTSTRAP_CONFIG=${rootdir}/etc/tox-bootstrapd.conf
|
||||
echo "port = $TOX_PORT" > $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'keys_file_path = "/var/lib/tox-bootstrapd/keys"' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'pid_file_path = "/var/run/tox-bootstrapd/tox-bootstrapd.pid"' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'enable_ipv6 = true' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'enable_ipv4_fallback = true' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'enable_lan_discovery = true' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'enable_tcp_relay = true' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo "tcp_relay_ports = [443, 3389, $TOX_PORT]" >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'enable_motd = true' >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo 'motd = "tox-bootstrapd"' >> $TOX_BOOTSTRAP_CONFIG
|
||||
|
||||
if [ $TOX_NODES ]; then
|
||||
echo 'bootstrap_nodes = (' >> $TOX_BOOTSTRAP_CONFIG
|
||||
toxcount=0
|
||||
while [ "x${TOX_NODES[toxcount]}" != "x" ]
|
||||
do
|
||||
toxval_ipv4=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $1}')
|
||||
toxval_ipv6=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $2}')
|
||||
toxval_port=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $3}')
|
||||
toxval_pubkey=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $4}')
|
||||
toxval_maintainer=$(echo $TOX_NODES[toxcount] | awk -F ',' '{print $5}')
|
||||
echo "{ // $toxval_maintainer" >> $TOX_BOOTSTRAP_CONFIG
|
||||
if [[ $toxval_ipv6 != 'NONE' ]]; then
|
||||
echo " address = \"$toxval_ipv6\"" >> $TOX_BOOTSTRAP_CONFIG
|
||||
else
|
||||
echo " address = \"$toxval_ipv4\"" >> $TOX_BOOTSTRAP_CONFIG
|
||||
fi
|
||||
echo " port = $toxval_port" >> $TOX_BOOTSTRAP_CONFIG
|
||||
echo " public_key = \"$toxval_pubkey\"" >> $TOX_BOOTSTRAP_CONFIG
|
||||
toxcount=$(( $toxcount + 1 ))
|
||||
if [ "x${TOX_NODES[toxcount]}" != "x" ]; then
|
||||
echo "}," >> $TOX_BOOTSTRAP_CONFIG
|
||||
else
|
||||
echo "}" >> $TOX_BOOTSTRAP_CONFIG
|
||||
fi
|
||||
done
|
||||
echo ')' >> $TOX_BOOTSTRAP_CONFIG
|
||||
if ! grep -q "Toxcore commit" $rootdir$COMPLETION_FILE; then
|
||||
echo "Toxcore commit:$TOXCORE_COMMIT" >> $rootdir$COMPLETION_FILE
|
||||
else
|
||||
sed -i "s|Toxcore commit.*|Toxcore commit:$TOXCORE_COMMIT|g" $rootdir$COMPLETION_FILE
|
||||
fi
|
||||
|
||||
if [ ! -f $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
|
||||
echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
|
||||
return
|
||||
fi
|
||||
cp $rootdir/$INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service $rootdir/etc/systemd/system/
|
||||
sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' $rootdir/etc/systemd/system/tox-bootstrapd.service
|
||||
|
||||
chroot "$rootdir" systemctl daemon-reload
|
||||
chroot "$rootdir" systemctl enable tox-bootstrapd.service
|
||||
}
|
||||
|
||||
function mesh_tox_client {
|
||||
|
|
Loading…
Reference in New Issue