Mesh script can also run on a 'server' (i.e. a dedicated peer)
This commit is contained in:
parent
7b0ef394c8
commit
b7c8141ae5
|
@ -40,6 +40,12 @@ TOX_PORT=33445
|
||||||
TOXCORE_REPO='git://github.com/irungentoo/toxcore.git'
|
TOXCORE_REPO='git://github.com/irungentoo/toxcore.git'
|
||||||
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
|
TOX_BOOTSTRAP_ID_FILE=/var/lib/tox-bootstrapd/pubkey.txt
|
||||||
|
|
||||||
|
# client or server installations sounds odd for a mesh, but this
|
||||||
|
# indicates whether this is a dedicated mesh peer ("yes") or
|
||||||
|
# a 'client' such as a laptop or desktop machine with
|
||||||
|
# the freedombone-client script installed
|
||||||
|
SERVER_INSTALLATION="no"
|
||||||
|
|
||||||
function install_toxcore {
|
function install_toxcore {
|
||||||
if [ -f /etc/tox-bootstrapd.conf ]; then
|
if [ -f /etc/tox-bootstrapd.conf ]; then
|
||||||
return
|
return
|
||||||
|
@ -207,9 +213,15 @@ function run_tox {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -f /var/lib/batman ]; then
|
||||||
|
SERVER_INSTALLATION="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||||
if [ ! -f /usr/bin/batman ]; then
|
if [ ! -f /usr/bin/batman ]; then
|
||||||
freedombone-client
|
freedombone-client
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# alternative toxic paths
|
# alternative toxic paths
|
||||||
if [ -f /usr/local/bin/toxic ]; then
|
if [ -f /usr/local/bin/toxic ]; then
|
||||||
|
@ -219,6 +231,7 @@ if [ -f /usr/local/share/toxic/DHTnodes ]; then
|
||||||
DHTNODES=/usr/local/share/toxic/DHTnodes
|
DHTNODES=/usr/local/share/toxic/DHTnodes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||||
if [ ! -f /tmp/meshtype ]; then
|
if [ ! -f /tmp/meshtype ]; then
|
||||||
install_toxcore
|
install_toxcore
|
||||||
install_toxid
|
install_toxid
|
||||||
|
@ -227,6 +240,7 @@ if [ ! -f /tmp/meshtype ]; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
avahi-browse -atl | grep "Workstation" | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
|
avahi-browse -atl | grep "Workstation" | awk -F ' ' '{print $4}' | sort -u > $PEERS_FILE
|
||||||
|
|
||||||
|
@ -294,7 +308,9 @@ if [ ! -f $IRSSI_PATH ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo 'You need irssi/mumble/toxic installed on your system'
|
echo 'You need irssi/mumble/toxic installed on your system'
|
||||||
|
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||||
sudo batman stop
|
sudo batman stop
|
||||||
|
fi
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -307,7 +323,9 @@ if [ ! -f $MUMBLE_PATH ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo 'You need irssi/mumble/toxic installed on your system'
|
echo 'You need irssi/mumble/toxic installed on your system'
|
||||||
|
if [[ $SERVER_INSTALLATION == "no" ]]; then
|
||||||
sudo batman stop
|
sudo batman stop
|
||||||
|
fi
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue