Merge pull request #36 from ivanilves/makefile

Makefile
This commit is contained in:
Ivan Ilves 2017-06-05 12:23:54 +02:00 committed by GitHub
commit 2f2fbae3f3
6 changed files with 35 additions and 3 deletions

9
INSTALL-HELP.txt Normal file
View File

@ -0,0 +1,9 @@
Run:
* "sudo make install" to install xiringuito
* "sudo make unistall" to uninstall xiringuito
HINT:
By default it will install software into `/usr/local/xiringuito` path
and will add 2 wrappers, xiringuito and xaval, into `/usr/local/bin`.

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
INSTALL_PATH=/usr/local/xiringuito
WRAPPER_PATH=/usr/local/bin
help:
@cat INSTALL-HELP.txt
install:
rsync -a ./ $(INSTALL_PATH)/
install -o root -g root -m 0755 wrapper $(WRAPPER_PATH)/xiringuito
install -o root -g root -m 0755 wrapper $(WRAPPER_PATH)/xaval
sed -i "s|__INSTALL_PATH__|$(INSTALL_PATH)|g" $(WRAPPER_PATH)/xiringuito $(WRAPPER_PATH)/xaval
uninstall:
rm $(WRAPPER_PATH)/xiringuito $(WRAPPER_PATH)/xaval
rm -r $(INSTALL_PATH)

View File

@ -37,7 +37,7 @@ As long as your routes do not overlap, you can run as many `xiringuito` tunnels
## xirin... WHAT?
"xiringuito" is a Catalan way of saying popular Spanish word "chiringuito", which usually means a beach bar in a more or less provisional building. As long as such places usually stand on a loose surface, operate without license and work only with cash, in urban dictionary "chiringuito" could mean any dodgy business, any activity of questional legality and confidence. I've picked up this name because I've wrote this as a quick temporary hack, partially in a bus, partially in a train, while travelling back and forth between job and home. But ... nothing is more permanent than the temporary, right? :smile:
<img src="xiringuito.png" width="256px" />
<img src="images/xiringuito.png" width="256px" />
## Xaval: connection manager
**NB!** To ease xiringuito configuration `xaval` connection manager script (is inside the project) could be used.

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

4
wrapper Normal file
View File

@ -0,0 +1,4 @@
#/usr/bin/env bash
cd __INSTALL_PATH__
./$(basename ${0}) ${@}

View File

@ -203,12 +203,16 @@ while [[ ${FAILED_PINGS} -lt ${MAX_FAILED_PINGS} ]]; do
exit 0
fi
FAILED_PINGS=0
./scripts/client-ping-server.sh ${TUNNEL_ID} ${IP_BASE}
if [[ ${?} -ne 0 ]]; then
let FAILED_PINGS+=1
echo "* Failed to ping server-side tunnel endpoint... (${FAILED_PINGS}/${MAX_FAILED_PINGS})"
echo "- Failed to ping server-side tunnel endpoint... (${FAILED_PINGS}/${MAX_FAILED_PINGS})"
else
FAILED_PINGS=0
if [[ ${FAILED_PINGS} -gt 0 ]]; then
FAILED_PINGS=0
echo "+ Connectivity restored!"
fi
fi
sleep 1