Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
f7dca26b
Commit
f7dca26b
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
utils should only contain functions
parent
e3627b66
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-mesh-batman
+1
-0
1 addition, 0 deletions
src/freedombone-mesh-batman
src/freedombone-mesh-bmx6
+1
-0
1 addition, 0 deletions
src/freedombone-mesh-bmx6
src/freedombone-utils-mesh
+45
-43
45 additions, 43 deletions
src/freedombone-utils-mesh
with
47 additions
and
43 deletions
src/freedombone-mesh-batman
+
1
−
0
View file @
f7dca26b
...
...
@@ -37,6 +37,7 @@ HOTSPOT_PASSPHRASE="${PROJECT_NAME}"
source
/usr/share/
${
PROJECT_NAME
}
/utils/
${
PROJECT_NAME
}
-utils-wifi
source
/usr/share/
${
PROJECT_NAME
}
/utils/
${
PROJECT_NAME
}
-utils-mesh
mesh_protocol_init
update_wifi_adaptors
if
[
!
$IFACE
]
;
then
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-mesh-bmx6
+
1
−
0
View file @
f7dca26b
...
...
@@ -37,6 +37,7 @@ HOTSPOT_PASSPHRASE="${PROJECT_NAME}"
source
/usr/share/
${
PROJECT_NAME
}
/utils/
${
PROJECT_NAME
}
-utils-wifi
source
/usr/share/
${
PROJECT_NAME
}
/utils/
${
PROJECT_NAME
}
-utils-mesh
mesh_protocol_init
update_wifi_adaptors
if
[
!
$IFACE
]
;
then
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-mesh
+
45
−
43
View file @
f7dca26b
...
...
@@ -28,56 +28,58 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if
[[
$1
==
"start"
]]
;
then
# install avahi
sed
-i
"s|#host-name=.*|host-name=
$(
hostname
)
|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|host-name=.*|host-name=
$(
hostname
)
|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|use-ipv4=.*|use-ipv4=yes|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|use-ipv6=.*|use-ipv6=no|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|#disallow-other-stacks=.*|disallow-other-stacks=yes|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|hosts:.*|hosts: files mdns4_minimal dns mdns4 mdns|g"
/etc/nsswitch.conf
fi
function
mesh_protocol_init
{
if
[[
$1
==
"start"
]]
;
then
# install avahi
sed
-i
"s|#host-name=.*|host-name=
$(
hostname
)
|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|host-name=.*|host-name=
$(
hostname
)
|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|use-ipv4=.*|use-ipv4=yes|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|use-ipv6=.*|use-ipv6=no|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|#disallow-other-stacks=.*|disallow-other-stacks=yes|g"
/etc/avahi/avahi-daemon.conf
sed
-i
"s|hosts:.*|hosts: files mdns4_minimal dns mdns4 mdns|g"
/etc/nsswitch.conf
fi
# Mesh definition
WIFI_SSID
=
'mesh'
if
[
-f
$COMPLETION_FILE
]
;
then
if
grep
-q
"WIFI_SSID:"
$COMPLETION_FILE
;
then
WIFI_SSID
=
$(
cat
$COMPLETION_FILE
|
grep
"WIFI_SSID:"
|
awk
-F
':'
'{print $2}'
)
# Mesh definition
WIFI_SSID
=
'mesh'
if
[
-f
$COMPLETION_FILE
]
;
then
if
grep
-q
"WIFI_SSID:"
$COMPLETION_FILE
;
then
WIFI_SSID
=
$(
cat
$COMPLETION_FILE
|
grep
"WIFI_SSID:"
|
awk
-F
':'
'{print $2}'
)
fi
sed
-i
"s|WIFI_SSID:.*|WIFI_SSID:
${
WIFI_SSID
}
|g"
$COMPLETION_FILE
fi
sed
-i
"s|WIFI_SSID:.*|WIFI_SSID:
${
WIFI_SSID
}
|g"
$COMPLETION_FILE
fi
CELLID
=
'any'
CELLID
=
'any'
CHANNEL
=
2
HOTSPOT_CHANNEL
=
6
if
[
-f
$COMPLETION_FILE
]
;
then
if
grep
-q
"Wifi channel:"
$COMPLETION_FILE
;
then
CHANNEL
=
$(
cat
$COMPLETION_FILE
|
grep
"Wifi channel:"
|
awk
-F
':'
'{print $2}'
)
CHANNEL
=
2
HOTSPOT_CHANNEL
=
6
if
[
-f
$COMPLETION_FILE
]
;
then
if
grep
-q
"Wifi channel:"
$COMPLETION_FILE
;
then
CHANNEL
=
$(
cat
$COMPLETION_FILE
|
grep
"Wifi channel:"
|
awk
-F
':'
'{print $2}'
)
fi
sed
-i
"s|Wifi channel:.*|Wifi channel:
${
CHANNEL
}
|g"
$COMPLETION_FILE
fi
sed
-i
"s|Wifi channel:.*|Wifi channel:
${
CHANNEL
}
|g"
$COMPLETION_FILE
fi
ZERONET_PORT
=
15441
IPFS_PORT
=
4001
TOX_PORT
=
33445
TRACKER_PORT
=
6969
LIBREVAULT_PORT
=
42345
TAHOELAFS_PORT
=
50213
GIT_SSB_PORT
=
7718
NGINX_GIT_SSB_PORT
=
7719
ZERONET_PORT
=
15441
IPFS_PORT
=
4001
TOX_PORT
=
33445
TRACKER_PORT
=
6969
LIBREVAULT_PORT
=
42345
TAHOELAFS_PORT
=
50213
GIT_SSB_PORT
=
7718
NGINX_GIT_SSB_PORT
=
7719
# Ethernet bridge definition (bridged to bat0)
BRIDGE
=
br-mesh
BRIDGE_HOTSPOT
=
br-hotspot
IFACE
=
IFACE_SECONDARY
=
EIFACE
=
eth0
WLAN_ADAPTORS
=
$(
count_wlan
)
# Ethernet bridge definition (bridged to bat0)
BRIDGE
=
br-mesh
BRIDGE_HOTSPOT
=
br-hotspot
IFACE
=
IFACE_SECONDARY
=
EIFACE
=
eth0
WLAN_ADAPTORS
=
$(
count_wlan
)
if
[
$WLAN_ADAPTORS
-eq
0
]
;
then
echo
$'No wlan adaptors found'
exit
0
fi
if
[
$WLAN_ADAPTORS
-eq
0
]
;
then
echo
$'No wlan adaptors found'
exit
0
fi
}
function
get_ipv4_wlan
{
echo
$(
ip
-o
-f
inet addr show dev
"
$IFACE
"
|
awk
'{print $4}'
|
awk
'END {print}'
|
awk
-F
'/'
'{print $1}'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment