Detect ipv6 addresses
This commit is contained in:
parent
e29fe7b88b
commit
871a4f6cad
|
@ -107,12 +107,12 @@ function mesh_protocol_init {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_ipv4_wlan {
|
function get_ipv6_wlan {
|
||||||
echo $(ip -o -f inet addr show dev "$IFACE" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
|
echo $(ifconfig ${IFACE} | grep inet6 | awk -F ' ' '{print $2}')
|
||||||
}
|
}
|
||||||
|
|
||||||
function mesh_hotspot_ip_address {
|
function mesh_hotspot_ip_address {
|
||||||
echo $(ip -o -f inet addr show dev "${BRIDGE}" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
|
echo $(ifconfig ${BRIDGE} | grep inet6 | awk -F ' ' '{print $2}')
|
||||||
}
|
}
|
||||||
|
|
||||||
function global_rate_limit {
|
function global_rate_limit {
|
||||||
|
@ -368,7 +368,7 @@ function enable_mesh_scuttlebot {
|
||||||
if [ -f /etc/scuttlebot/.ssb/config ]; then
|
if [ -f /etc/scuttlebot/.ssb/config ]; then
|
||||||
ethernet_connected=$(cat /sys/class/net/eth0/carrier)
|
ethernet_connected=$(cat /sys/class/net/eth0/carrier)
|
||||||
if [[ "$ethernet_connected" != "0" ]]; then
|
if [[ "$ethernet_connected" != "0" ]]; then
|
||||||
sed -i "s|\"host\": .*|\"host\": \"$(get_ipv4_wlan)\",|g" /etc/scuttlebot/.ssb/config
|
sed -i "s|\"host\": .*|\"host\": \"$(get_ipv6_wlan)\",|g" /etc/scuttlebot/.ssb/config
|
||||||
systemctl restart scuttlebot
|
systemctl restart scuttlebot
|
||||||
else
|
else
|
||||||
if [ ! -f /etc/nginx/sites-available/git_ssb ]; then
|
if [ ! -f /etc/nginx/sites-available/git_ssb ]; then
|
||||||
|
|
Loading…
Reference in New Issue