Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSB Peering #12

Open
darkdrgn2k opened this issue Jul 16, 2018 · 1 comment
Open

SSB Peering #12

darkdrgn2k opened this issue Jul 16, 2018 · 1 comment

Comments

@darkdrgn2k
Copy link
Contributor

Modified broadcast script to "advertise" all users created on the ssb-web client

to do:

  • maybe only ones that are online (not idle?)
  • add && echo $id to advertise the pi, or maybe not?
#!/bin/bash
id=$(sbot whoami | grep id | awk -F "\"" '{print $4}' | sed 's/.ed25519//' | sed 's/@//')

while true; do
  while read -r id; do
      for int in $(ls -1Atu /sys/class/net ); do
          ip=$(ip addr show $int | grep -v inet6 | grep -v '127.0.0.1' |grep inet | head -n 1 | awk '{print $2}' | awk -F "/" '{print $1}')
          if ! [ -z "$ip" ]; then
              echo -n "net:$ip:8008~shs:$id" |  socat -T 1 - UDP4-DATAGRAM:255.255.255.255:8008,broadcast,so-bindtodevice=$int &
              echo  "net:$ip:8008~shs:$id"
          fi
      done
  done <<< $(sudo cat /var/www/backend/keys/* | grep id | grep -v "#" | awk '{print $2}' | tr -d '"' | sed 's/.ed25519//' | sed 's/@//')
  sleep 15

done
@darkdrgn2k
Copy link
Contributor Author

From a prototype perspective maybe drop the $ID stuff and run this as a separate service
(more distinc uninstall line between ssb-web and ssb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant