Scriptifying more things
This commit is contained in:
parent
230479b7e0
commit
8da1ff40a3
|
@ -642,6 +642,7 @@ function mesh_tox_node {
|
||||||
echo ' exit 1' >> $TEMP_SCRIPT
|
echo ' exit 1' >> $TEMP_SCRIPT
|
||||||
echo 'fi' >> $TEMP_SCRIPT
|
echo 'fi' >> $TEMP_SCRIPT
|
||||||
echo 'make install' >> $TEMP_SCRIPT
|
echo 'make install' >> $TEMP_SCRIPT
|
||||||
|
echo 'cp /usr/local/lib/libtoxcore* /usr/lib/' >> $TEMP_SCRIPT
|
||||||
echo 'exit 0' >> $TEMP_SCRIPT
|
echo 'exit 0' >> $TEMP_SCRIPT
|
||||||
chmod +x $TEMP_SCRIPT
|
chmod +x $TEMP_SCRIPT
|
||||||
cp $TEMP_SCRIPT $rootdir/root/
|
cp $TEMP_SCRIPT $rootdir/root/
|
||||||
|
@ -652,11 +653,12 @@ function mesh_tox_node {
|
||||||
duration=$SECONDS
|
duration=$SECONDS
|
||||||
echo $"Toxcore compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
echo $"Toxcore compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
||||||
echo $'Unable to make toxcore'
|
echo $'Unable to make toxcore'
|
||||||
|
rm $TEMP_SCRIPT
|
||||||
exit 73835
|
exit 73835
|
||||||
fi
|
fi
|
||||||
duration=$SECONDS
|
duration=$SECONDS
|
||||||
echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
echo $"Toxcore compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
||||||
chroot "$rootdir" cp /usr/local/lib/libtoxcore* /usr/lib/
|
rm $TEMP_SCRIPT
|
||||||
|
|
||||||
if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
|
if [ ! -f $rootdir/usr/local/bin/tox-bootstrapd ]; then
|
||||||
echo $"File not found /usr/local/bin/tox-bootstrapd"
|
echo $"File not found /usr/local/bin/tox-bootstrapd"
|
||||||
|
@ -738,25 +740,33 @@ function mesh_tox_avahi {
|
||||||
exit 78252
|
exit 78252
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install a command to obtain the Tox ID
|
TEMP_SCRIPT_NAME=fbtmp5328252.sh
|
||||||
git clone $TOXID_REPO $rootdir$INSTALL_DIR/toxid
|
TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
|
||||||
|
echo '#!/bin/bash' > $TEMP_SCRIPT
|
||||||
|
echo "mkdir -p $INSTALL_DIR" >> $TEMP_SCRIPT
|
||||||
|
echo "git clone $TOXID_REPO $INSTALL_DIR/toxid" >> $TEMP_SCRIPT
|
||||||
|
echo "if [ ! -d $INSTALL_DIR/toxid ]; then" >> $TEMP_SCRIPT
|
||||||
|
echo ' exit 1' >> $TEMP_SCRIPT
|
||||||
|
echo 'fi' >> $TEMP_SCRIPT
|
||||||
|
echo "cd $INSTALL_DIR/toxid" >> $TEMP_SCRIPT
|
||||||
|
echo "make" >> $TEMP_SCRIPT
|
||||||
|
echo 'if [ ! "$?" = "0" ]; then' >> $TEMP_SCRIPT
|
||||||
|
echo ' exit 2' >> $TEMP_SCRIPT
|
||||||
|
echo 'fi' >> $TEMP_SCRIPT
|
||||||
|
echo 'make install' >> $TEMP_SCRIPT
|
||||||
|
echo 'toxavahi' >> $TEMP_SCRIPT
|
||||||
|
echo 'echo "* * * * * root toxavahi > /dev/null" >> /etc/crontab' >> $TEMP_SCRIPT
|
||||||
|
echo 'exit 0' >> $TEMP_SCRIPT
|
||||||
|
chmod +x $TEMP_SCRIPT
|
||||||
|
cp $TEMP_SCRIPT $rootdir/root/
|
||||||
|
|
||||||
if [ ! -d $rootdir$INSTALL_DIR/toxid ]; then
|
chroot "$rootdir" /root/$TEMP_SCRIPT_NAME
|
||||||
echo $'toxid repo not found'
|
|
||||||
exit 52682
|
|
||||||
fi
|
|
||||||
cd $rootdir$INSTALL_DIR/toxid
|
|
||||||
chroot "$rootdir" make
|
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
echo $'Failed to compile toxid'
|
echo $'Unable to install toxid'
|
||||||
exit 58432
|
rm $TEMP_SCRIPT
|
||||||
|
exit 62835
|
||||||
fi
|
fi
|
||||||
chroot "$rootdir" make install
|
rm $TEMP_SCRIPT
|
||||||
|
|
||||||
chroot "$rootdir" toxavahi
|
|
||||||
|
|
||||||
# publish regularly
|
|
||||||
echo "* * * * * root toxavahi > /dev/null" >> $rootdir/etc/crontab
|
|
||||||
|
|
||||||
chroot "$rootdir" systemctl restart avahi-daemon
|
chroot "$rootdir" systemctl restart avahi-daemon
|
||||||
}
|
}
|
||||||
|
@ -790,18 +800,21 @@ function mesh_tox_client {
|
||||||
chroot "$rootdir" apt-get -y install libncursesw5-dev libconfig-dev libqrencode-dev
|
chroot "$rootdir" apt-get -y install libncursesw5-dev libconfig-dev libqrencode-dev
|
||||||
chroot "$rootdir" apt-get -y install libcurl4-openssl-dev libvpx-dev libopenal-dev
|
chroot "$rootdir" apt-get -y install libcurl4-openssl-dev libvpx-dev libopenal-dev
|
||||||
|
|
||||||
if [ ! -d $rootdir$INSTALL_DIR ]; then
|
TEMP_SCRIPT_NAME=fbtmp728353.sh
|
||||||
mkdir -p $rootdir$INSTALL_DIR
|
TEMP_SCRIPT=/tmp/$TEMP_SCRIPT_NAME
|
||||||
fi
|
echo '#!/bin/bash' > $TEMP_SCRIPT
|
||||||
git clone $TOXIC_REPO $rootdir$INSTALL_DIR/toxic
|
echo "mkdir -p $INSTALL_DIR" >> $TEMP_SCRIPT
|
||||||
cd $rootdir$INSTALL_DIR/toxic
|
echo "git clone $TOXIC_REPO $INSTALL_DIR/toxic" >> $TEMP_SCRIPT
|
||||||
git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT
|
echo "cd $INSTALL_DIR/toxic" >> $TEMP_SCRIPT
|
||||||
|
echo "git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT" >> $TEMP_SCRIPT
|
||||||
if ! grep -q "Toxic commit" $rootdir$COMPLETION_FILE; then
|
echo 'make' >> $TEMP_SCRIPT
|
||||||
echo "Toxic commit:$TOXIC_COMMIT" >> $rootdir$COMPLETION_FILE
|
echo 'if [ ! "$?" = "0" ]; then' >> $TEMP_SCRIPT
|
||||||
else
|
echo ' exit 1' >> $TEMP_SCRIPT
|
||||||
sed -i "s|Toxic commit.*|Toxic commit:$TOXIC_COMMIT|g" $rootdir$COMPLETION_FILE
|
echo 'fi' >> $TEMP_SCRIPT
|
||||||
fi
|
echo 'make install' >> $TEMP_SCRIPT
|
||||||
|
echo 'exit 0' >> $TEMP_SCRIPT
|
||||||
|
chmod +x $TEMP_SCRIPT
|
||||||
|
cp $TEMP_SCRIPT $rootdir/root/
|
||||||
|
|
||||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
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}')
|
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
|
||||||
|
@ -809,20 +822,16 @@ function mesh_tox_client {
|
||||||
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
|
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME} | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $rootdir$INSTALL_DIR/toxic ]; then
|
|
||||||
echo $"$INSTALL_DIR/toxic not found"
|
|
||||||
exit 347835
|
|
||||||
fi
|
|
||||||
|
|
||||||
SECONDS=0
|
SECONDS=0
|
||||||
chroot "$rootdir" make
|
chroot "$rootdir" /root/$TEMP_SCRIPT_NAME
|
||||||
if [ ! -f $rootdir$INSTALL_DIR/toxic/build/toxic ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
duration=$SECONDS
|
duration=$SECONDS
|
||||||
echo $"Toxic client compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
echo $"Toxic client compile failed at $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
|
||||||
echo $'Unable to make tox client'
|
echo $'Unable to make tox client'
|
||||||
|
rm $TEMP_SCRIPT
|
||||||
exit 74872
|
exit 74872
|
||||||
fi
|
fi
|
||||||
chroot "$rootdir" make install
|
rm $TEMP_SCRIPT
|
||||||
if [ ! -f $rootdir$TOXIC_FILE ]; then
|
if [ ! -f $rootdir$TOXIC_FILE ]; then
|
||||||
echo $"Tox client was not installed to $TOXIC_FILE"
|
echo $"Tox client was not installed to $TOXIC_FILE"
|
||||||
exit 63278
|
exit 63278
|
||||||
|
|
Loading…
Reference in New Issue