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
81c2c544
Commit
81c2c544
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Check that mac address gets generated
parent
a5d2b6a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-mesh-batman
+46
-41
46 additions, 41 deletions
src/freedombone-mesh-batman
with
46 additions
and
41 deletions
src/freedombone-mesh-batman
+
46
−
41
View file @
81c2c544
...
...
@@ -229,13 +229,15 @@ function start {
ifconfig
$IFACE
down
ifconfig
$IFACE
mtu 1532
peeraddr
=
$(
assign_peer_address
)
ifconfig
$IFACE
hw ether
$peeraddr
echo
$"
$IFACE
assigned MAC address
$peeraddr
"
peermac
=
$(
assign_peer_address
)
if
[
!
$peermac
]
;
then
echo
$"Unable to obtain MAC address for
$peermac
"
return
fi
ifconfig
$IFACE
hw ether
$peermac
echo
$"
$IFACE
assigned MAC address
$peermac
"
iwconfig
$IFACE
enc off
iwconfig
$IFACE
mode ad-hoc essid
$WIFI_SSID
channel
$CHANNEL
sleep
1
iwconfig
$IFACE
ap
$CELLID
modprobe batman-adv
batctl
if
add
$IFACE
...
...
@@ -264,42 +266,45 @@ function start {
HOTSPOT_NAME
=
$"
${
WIFI_SSID
}
-hotspot"
ifconfig
$IFACE_SECONDARY
down
ifconfig
$IFACE_SECONDARY
mtu 1500
peeraddr
=
$(
assign_peer_address
)
ifconfig
$IFACE_SECONDARY
hw ether
$peeraddr
echo
$"Secondary wifi adaptor
$IFACE_SECONDARY
assigned to MAC address
$peeraddr
"
iwconfig
$IFACE_SECONDARY
enc open
iwconfig
$IFACE_SECONDARY
mode managed essid
$HOTSPOT_NAME
channel
${
HOTSPOT_CHANNEL
}
iwconfig
$IFACE_SECONDARY
ap
$CELLID
brctl addbr
$BRIDGE_HOTSPOT
brctl addif
$BRIDGE_HOTSPOT
bat0
brctl addif
$BRIDGE_HOTSPOT
$IFACE_SECONDARY
ifconfig bat0 0.0.0.0
ifconfig
$IFACE_SECONDARY
0.0.0.0
sed
-i
's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g'
/etc/default/hostapd
echo
"interface=
${
IFACE_SECONDARY
}
"
>
/etc/hostapd/hostapd.conf
echo
"bridge=
${
BRIDGE_HOTSPOT
}
"
>>
/etc/hostapd/hostapd.conf
echo
'driver=nl80211'
>>
/etc/hostapd/hostapd.conf
echo
"country_code=UK"
>>
/etc/hostapd/hostapd.conf
echo
"ssid=
$HOTSPOT_NAME
"
>>
/etc/hostapd/hostapd.conf
echo
'hw_mode=g'
>>
/etc/hostapd/hostapd.conf
echo
"channel=
${
HOTSPOT_CHANNEL
}
"
>>
/etc/hostapd/hostapd.conf
echo
'wpa=2'
>>
/etc/hostapd/hostapd.conf
echo
"wpa_passphrase=
$HOTSPOT_PASSPHRASE
"
>>
/etc/hostapd/hostapd.conf
echo
'wpa_key_mgmt=WPA-PSK'
>>
/etc/hostapd/hostapd.conf
echo
'wpa_pairwise=TKIP'
>>
/etc/hostapd/hostapd.conf
echo
'rsn_pairwise=CCMP'
>>
/etc/hostapd/hostapd.conf
echo
'auth_algs=1'
>>
/etc/hostapd/hostapd.conf
echo
'macaddr_acl=0'
>>
/etc/hostapd/hostapd.conf
ifconfig
$BRIDGE_HOTSPOT
up
avahi-autoipd
--force-bind
--daemonize
--wait
$BRIDGE_HOTSPOT
ifconfig
$IFACE_SECONDARY
up promisc
#ifconfig $IFACE_SECONDARY auto-dhcp start
systemctl start hostapd
hotspot_enabled
=
1
CELLID
=
$(
assign_peer_address
)
if
[
$CELLID
]
;
then
ifconfig
$IFACE_SECONDARY
hw ether
$CELLID
echo
$"Secondary wifi adaptor
$IFACE_SECONDARY
assigned to MAC address
$CELLID
"
iwconfig
$IFACE_SECONDARY
enc open
iwconfig
$IFACE_SECONDARY
mode managed essid
$HOTSPOT_NAME
channel
${
HOTSPOT_CHANNEL
}
iwconfig
$IFACE_SECONDARY
ap
$CELLID
iwconfig
$IFACE
ap
$CELLID
brctl addbr
$BRIDGE_HOTSPOT
brctl addif
$BRIDGE_HOTSPOT
bat0
brctl addif
$BRIDGE_HOTSPOT
$IFACE_SECONDARY
ifconfig bat0 0.0.0.0
ifconfig
$IFACE_SECONDARY
0.0.0.0
sed
-i
's|#DAEMON_CONF=.*|DAEMON_CONF="/etc/hostapd/hostapd.conf"|g'
/etc/default/hostapd
echo
"interface=
${
IFACE_SECONDARY
}
"
>
/etc/hostapd/hostapd.conf
echo
"bridge=
${
BRIDGE_HOTSPOT
}
"
>>
/etc/hostapd/hostapd.conf
echo
'driver=nl80211'
>>
/etc/hostapd/hostapd.conf
echo
"country_code=UK"
>>
/etc/hostapd/hostapd.conf
echo
"ssid=
$HOTSPOT_NAME
"
>>
/etc/hostapd/hostapd.conf
echo
'hw_mode=g'
>>
/etc/hostapd/hostapd.conf
echo
"channel=
${
HOTSPOT_CHANNEL
}
"
>>
/etc/hostapd/hostapd.conf
echo
'wpa=2'
>>
/etc/hostapd/hostapd.conf
echo
"wpa_passphrase=
$HOTSPOT_PASSPHRASE
"
>>
/etc/hostapd/hostapd.conf
echo
'wpa_key_mgmt=WPA-PSK'
>>
/etc/hostapd/hostapd.conf
echo
'wpa_pairwise=TKIP'
>>
/etc/hostapd/hostapd.conf
echo
'rsn_pairwise=CCMP'
>>
/etc/hostapd/hostapd.conf
echo
'auth_algs=1'
>>
/etc/hostapd/hostapd.conf
echo
'macaddr_acl=0'
>>
/etc/hostapd/hostapd.conf
ifconfig
$BRIDGE_HOTSPOT
up
avahi-autoipd
--force-bind
--daemonize
--wait
$BRIDGE_HOTSPOT
ifconfig
$IFACE_SECONDARY
up promisc
#ifconfig $IFACE_SECONDARY auto-dhcp start
systemctl start hostapd
hotspot_enabled
=
1
fi
fi
fi
fi
...
...
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