Remove unused compile functions

This commit is contained in:
Bob Mottram 2016-06-07 09:25:32 +01:00
parent ee2dd373ef
commit 3348a0c360
1 changed files with 0 additions and 172 deletions

View File

@ -302,175 +302,6 @@ function configure_zeronet_forum {
echo $'Update of ZeroNet Forum completed' >> $INSTALL_LOG
}
function compile_toxcore {
echo $'Compiling toxcore' >> $INSTALL_LOG
if [ ! -d $INSTALL_DIR/toxcore ]; then
echo $"$INSTALL_DIR/toxcore not found" >> $INSTALL_LOG
exit 63856
fi
cd $INSTALL_DIR/toxcore
SECONDS=0
if [ -f $INSTALL_DIR/configure_toxcore.txt ]; then
rm $INSTALL_DIR/configure_toxcore.txt
fi
if [ -f $INSTALL_DIR/make_toxcore.txt ]; then
rm $INSTALL_DIR/make_toxcore.txt
fi
aclocal
autoreconf -vfi
./configure --enable-daemon --disable-av > $INSTALL_DIR/configure_toxcore.txt
make clean
make -k > $INSTALL_DIR/make_toxcore.txt
if [ ! "$?" = "0" ]; then
duration=$SECONDS
echo $"Toxcore compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." >> $INSTALL_LOG
echo $'Unable to make toxcore' >> $INSTALL_LOG
echo $'See $INSTALL_DIR/make_toxcore.txt' >> $INSTALL_LOG
exit 73835
fi
rm $INSTALL_DIR/configure_toxcore.txt
rm $INSTALL_DIR/make_toxcore.txt
make install
duration=$SECONDS
echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." >> $INSTALL_LOG
cp /usr/local/lib/libtoxcore* /usr/lib/
if [ ! -f /usr/local/bin/tox-bootstrapd ]; then
echo $"File not found /usr/local/bin/tox-bootstrapd" >> $INSTALL_LOG
exit 37825
fi
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
chmod 700 /var/lib/tox-bootstrapd
if [ ! -f $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf ]; then
echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.conf" >> $INSTALL_LOG
fi
# remove Maildir
if [ -d /var/lib/tox-bootstrapd/Maildir ]; then
rm -rf /var/lib/tox-bootstrapd/Maildir
fi
# create configuration file
TOX_BOOTSTRAP_CONFIG=/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
fi
if [ ! -f $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
echo $"File not found $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service" >> $INSTALL_LOG
return
fi
cp $INSTALL_DIR/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
sed -i 's|ExecStart=.*|ExecStart=/usr/local/bin/tox-bootstrapd --config /etc/tox-bootstrapd.conf|g' /etc/systemd/system/tox-bootstrapd.service
systemctl daemon-reload
systemctl enable tox-bootstrapd.service
echo $'toxcore compile completed' >> $INSTALL_LOG
}
function compile_toxid {
if [ ! -d $INSTALL_DIR/toxid ]; then
echo $'toxid repo not found' >> $INSTALL_LOG
exit 52682
fi
cd $INSTALL_DIR/toxid
if [ -f $INSTALL_DIR/make_toxid.txt ]; then
rm $INSTALL_DIR/make_toxid.txt
fi
make > $INSTALL_DIR/make_toxid.txt
if [ ! "$?" = "0" ]; then
echo $'Failed to compile toxid' >> $INSTALL_LOG
echo $"See $INSTALL_DIR/make_toxid.txt" >> $INSTALL_LOG
exit 58432
fi
rm $INSTALL_DIR/make_toxid.txt
make install
toxavahi
# publish regularly
if ! grep -q "toxavahi" /etc/crontab; then
echo "* * * * * root toxavahi > /dev/null" >> /etc/crontab
fi
systemctl restart avahi-daemon
}
function compile_tox_client {
echo $'Compiling tox client' >> $INSTALL_LOG
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ! -d $INSTALL_DIR/toxic ]; then
echo $"$INSTALL_DIR/toxic not found" >> $INSTALL_LOG
exit 347835
fi
cd $INSTALL_DIR/toxic
if [ -f $INSTALL_DIR/make_toxic.txt ]; then
rm $INSTALL_DIR/make_toxic.txt
fi
SECONDS=0
make clean
make -k > $INSTALL_DIR/make_toxic.txt
if [ ! -f $INSTALL_DIR/toxic/build/toxic ]; then
duration=$SECONDS
echo $"Toxic client compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." >> $INSTALL_LOG
echo $'Unable to make tox client' >> $INSTALL_LOG
echo $"See $INSTALL_DIR/make_toxic.txt" >> $INSTALL_LOG
exit 74872
fi
rm $INSTALL_DIR/make_toxic.txt
make install
if [ ! -f $TOXIC_FILE ]; then
echo $"Tox client was not installed to $TOXIC_FILE" >> $INSTALL_LOG
exit 63278
fi
duration=$SECONDS
echo $"Toxic client compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." >> $INSTALL_LOG
echo $'toxic client compile completed' >> $INSTALL_LOG
}
function configure_toxcore {
echo $'Configuring toxcore' >> $INSTALL_LOG
@ -547,9 +378,6 @@ if [ -f /root/.initial_mesh_setup ]; then
configure_zeronet_blog
configure_zeronet_mail
configure_zeronet_forum
#compile_toxcore
#compile_toxid
#compile_tox_client
configure_toxcore
configure_zeronet
disable_password_logins