Obtain tox port for firewall

This commit is contained in:
Bob Mottram 2016-07-12 16:48:21 +01:00
parent e479c43333
commit 2b586ff4a2
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
1 changed files with 10 additions and 9 deletions

View File

@ -201,6 +201,16 @@ function configure_firewall_for_tox {
if [[ $ONION_ONLY != "no" ]]; then
return
fi
TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
TOX_PORT=$TOX_PORT_MAIN
fi
if [ ! $TOX_PORT ]; then
echo $'No Tox port was specified'
exit 32856
fi
iptables -A INPUT -p tcp --dport $TOX_PORT -j ACCEPT
function_check save_firewall_settings
save_firewall_settings
@ -331,15 +341,6 @@ function mesh_tox_node {
exit 76325
fi
TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
TOX_PORT=$TOX_PORT_MAIN
fi
if [ ! $TOX_PORT ]; then
echo $'No Tox port was specified'
exit 32856
fi
TOXCORE_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then
TOXCORE_REPO=$TOXCORE_REPO_MAIN