Add the alfred anouncment for supernode's
This commit is contained in:
parent
1733978af2
commit
def69ebb8d
66
files/alfred.sh.j2
Normal file
66
files/alfred.sh.j2
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
release=$(/bin/uname -r)
|
||||||
|
nodeid=$( /bin/echo {{ sn_mesh_MAC }} | /bin/sed s/://g)
|
||||||
|
meshh_if=$(/bin/cat /sys/class/net/*/address | /bin/grep -v ^00:00:00)
|
||||||
|
tempfile=/tmp/alfred_info
|
||||||
|
|
||||||
|
if [ -f $tempfile ]
|
||||||
|
then
|
||||||
|
/bin/rm $tempfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
/bin/cat > $tempfile <<EOF
|
||||||
|
{
|
||||||
|
"network": {
|
||||||
|
"mac": "{{ sn_mesh_MAC }}",
|
||||||
|
"addresses": [
|
||||||
|
"{{ sn_mesh_IPv6 }}"
|
||||||
|
"{{ sn_mesh_IPv4 }}"
|
||||||
|
],
|
||||||
|
"mesh_interfaces": [
|
||||||
|
$(for i in $meshh_if; do /bin/echo '"'$i'",';done)
|
||||||
|
"{{ sn_mesh_MAC }}"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"vpn": true,
|
||||||
|
"node_id": "$nodeid",
|
||||||
|
"hostname": "Gateway:{{ sn_hostname }}",
|
||||||
|
"hardware": {'
|
||||||
|
"model": "{{ ansible_lsb.description }}"
|
||||||
|
},
|
||||||
|
"owner": {
|
||||||
|
"contact": "fftro/stefand"
|
||||||
|
},
|
||||||
|
"software": {
|
||||||
|
"fastd": {
|
||||||
|
"version": "v16",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"autoupdater": {
|
||||||
|
"enabled": false,
|
||||||
|
"branch": "server"
|
||||||
|
},
|
||||||
|
"firmware": {
|
||||||
|
"release": "$release",
|
||||||
|
"base": "{{ ansible_os_family }}"
|
||||||
|
},
|
||||||
|
"batman-adv": {
|
||||||
|
"compat": 15,
|
||||||
|
"version": "2014.3.0-47-g21f67df-dirty,"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -f $tempfile ]
|
||||||
|
then
|
||||||
|
/bin/cat "$tempfile" | /bin/gzip | /usr/sbin/alfred -s 158
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f $tempfile ]
|
||||||
|
then
|
||||||
|
/bin/rm $tempfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
@ -1,7 +1,7 @@
|
|||||||
# First install ssh-key at remote computer
|
# First install ssh-key at remote computer
|
||||||
# In case of python error start:
|
# In case of python error start:
|
||||||
# ansible troisdorf4 -u root -m raw -a "apt-get update && apt-get install python -y"
|
# ansible troisdorf4 -u root -m raw -a "apt-get update && apt-get install python -y"
|
||||||
# Version 3.1, gre-backbone
|
# Version 3.2, gre-backbone
|
||||||
|
|
||||||
- name: Install Freifunk Troisdorf super node
|
- name: Install Freifunk Troisdorf super node
|
||||||
# hosts: FreifunkSupernodesL2TP
|
# hosts: FreifunkSupernodesL2TP
|
||||||
@ -228,3 +228,7 @@
|
|||||||
delay=15
|
delay=15
|
||||||
timeout=300
|
timeout=300
|
||||||
when: tunneldigger.changed
|
when: tunneldigger.changed
|
||||||
|
- name: Alfed message
|
||||||
|
template: src=./files/alfred.sh.j2 dest=/opt/freifunk/alfred.sh owner=root group=root mode=0544
|
||||||
|
- name: Add cron job with alfred info script
|
||||||
|
cron: name=alfred_info job="/opt/freifunk//opt/freifunk/alfred.sh > /dev/null 2>&1" user="root"
|
||||||
|
Loading…
Reference in New Issue
Block a user