2015-11-28 20:35:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
release=$(/bin/uname -r)
|
|
|
|
nodeid=$( /bin/echo {{ sn_mesh_MAC }} | /bin/sed s/://g)
|
2015-12-09 11:53:42 +00:00
|
|
|
meshh_if=$(/bin/cat /sys/class/net/troisdorf*/address | /bin/grep -v ^00:00:00)
|
2015-11-28 20:35:11 +00:00
|
|
|
tempfile=/tmp/alfred_info
|
|
|
|
|
|
|
|
if [ -f $tempfile ]
|
|
|
|
then
|
|
|
|
/bin/rm $tempfile
|
|
|
|
fi
|
|
|
|
|
|
|
|
/bin/cat > $tempfile <<EOF
|
|
|
|
{
|
|
|
|
"network": {
|
|
|
|
"mac": "{{ sn_mesh_MAC }}",
|
|
|
|
"addresses": [
|
2015-11-29 21:34:32 +00:00
|
|
|
"{{ sn_mesh_IPv6 }}",
|
2015-11-28 20:35:11 +00:00
|
|
|
"{{ 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 }}",
|
2015-11-29 21:34:32 +00:00
|
|
|
"hardware": {
|
|
|
|
"model": "vServer"
|
2015-11-28 20:35:11 +00:00
|
|
|
},
|
|
|
|
"owner": {
|
2015-11-29 21:34:32 +00:00
|
|
|
"contact": "stefan@freifunk-troisdorf.de"
|
2015-11-28 20:35:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if [ -f $tempfile ]
|
|
|
|
then
|
2015-12-06 20:41:30 +00:00
|
|
|
/bin/cat "$tempfile" | /bin/gzip | /usr/local/sbin/alfred -s 158
|
2015-11-28 20:35:11 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $tempfile ]
|
|
|
|
then
|
|
|
|
/bin/rm $tempfile
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|