Skip to content
Snippets Groups Projects
Commit 588c5879 authored by Bob Mottram's avatar Bob Mottram
Browse files

Allow local ip addresses for scuttlebot

parent 20a89b7a
No related branches found
No related tags found
No related merge requests found
......@@ -795,6 +795,7 @@ function initialise_scuttlebot_pub {
echo '{' > /etc/scuttlebot/.ssb/config
echo " \"host\": \"${HOSTNAME}\"," >> /etc/scuttlebot/.ssb/config
echo " \"port\": ${SCUTTLEBOT_PORT}," >> /etc/scuttlebot/.ssb/config
echo ' "allowPrivate": true,' >> /etc/scuttlebot/.ssb/config
echo ' "timeout": 30000,' >> /etc/scuttlebot/.ssb/config
echo ' "pub": true,' >> /etc/scuttlebot/.ssb/config
echo ' "local": true,' >> /etc/scuttlebot/.ssb/config
......
......@@ -96,6 +96,10 @@ if [ -e /etc/default/batctl ]; then
. /etc/default/batctl
fi
function get_ipv6_bat0 {
echo $(ip -o -f inet6 addr show dev "bat0" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
}
function mesh_hotspot_ip_address {
echo $(ip -o -f inet addr show dev "$BRIDGE" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}')
}
......@@ -402,6 +406,12 @@ function start {
systemctl restart avahi-daemon
if [ -f /etc/scuttlebot/.ssb/config ]; then
ipv6addr=$(get_ipv6_bat0)
sed -i "s|\"host\": .*|\"host\": \"${ipv6addr}\",|g" /etc/scuttlebot/.ssb/config
systemctl restart scuttlebot
fi
verify
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment