function to remove cjdns
This commit is contained in:
parent
84b383b29c
commit
c892dedab4
|
@ -49,6 +49,9 @@ function configure_firewall_for_cjdns {
|
||||||
fi
|
fi
|
||||||
ip6tables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
|
ip6tables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
|
||||||
ip6tables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
ip6tables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
ip6tables -A INPUT -p udp --dport $CJDNS_PORT -j ACCEPT
|
||||||
|
ip6tables -A INPUT -p tcp --dport $CJDNS_PORT -j ACCEPT
|
||||||
|
|
||||||
function_check save_firewall_settings
|
function_check save_firewall_settings
|
||||||
save_firewall_settings
|
save_firewall_settings
|
||||||
echo 'configure_firewall_for_cjdns' >> $COMPLETION_FILE
|
echo 'configure_firewall_for_cjdns' >> $COMPLETION_FILE
|
||||||
|
@ -104,6 +107,23 @@ function get_cjdns_password {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function remove_cjdns {
|
||||||
|
if ! grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
service cjdns stop
|
||||||
|
ip6tables -t nat -D POSTROUTING -o tun0 -j MASQUERADE
|
||||||
|
ip6tables -D FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
ip6tables -D INPUT -p udp --dport $CJDNS_PORT -j ACCEPT
|
||||||
|
ip6tables -D INPUT -p tcp --dport $CJDNS_PORT -j ACCEPT
|
||||||
|
function_check save_firewall_settings
|
||||||
|
save_firewall_settings
|
||||||
|
|
||||||
|
rm -rf /etc/cjdns
|
||||||
|
sed -i '/mesh_cjdns/d' $COMPLETION_FILE
|
||||||
|
sed -i '/configure_firewall_for_cjdns/d' $COMPLETION_FILE
|
||||||
|
}
|
||||||
|
|
||||||
function mesh_cjdns {
|
function mesh_cjdns {
|
||||||
if [[ $ENABLE_CJDNS != "yes" ]]; then
|
if [[ $ENABLE_CJDNS != "yes" ]]; then
|
||||||
return
|
return
|
||||||
|
@ -348,12 +368,6 @@ function mesh_cjdns {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip6tables -A INPUT -p udp --dport $CJDNS_PORT -j ACCEPT
|
|
||||||
ip6tables -A INPUT -p tcp --dport $CJDNS_PORT -j ACCEPT
|
|
||||||
|
|
||||||
function_ckeck save_firewall_settings
|
|
||||||
save_firewall_settings
|
|
||||||
|
|
||||||
if ! grep -q $"Mesh Networking (cjdns)" /home/$MY_USERNAME/README; then
|
if ! grep -q $"Mesh Networking (cjdns)" /home/$MY_USERNAME/README; then
|
||||||
CURRENT_IP_ADDRESS=$(ip addr show | grep "inet " | sed -n 2p | awk -F ' ' '{print $2}' | awk -F '/' '{print $1}')
|
CURRENT_IP_ADDRESS=$(ip addr show | grep "inet " | sed -n 2p | awk -F ' ' '{print $2}' | awk -F '/' '{print $1}')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue