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
266c31e1
Unverified
Commit
266c31e1
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Improve wifi configuration
parent
c363cb9c
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-wifi
+25
-7
25 additions, 7 deletions
src/freedombone-wifi
with
25 additions
and
7 deletions
src/freedombone-wifi
+
25
−
7
View file @
266c31e1
...
...
@@ -111,12 +111,12 @@ function hotspot_on {
echo
'macaddr_acl=0'
>>
/etc/hostapd/hostapd.conf
if
[
!
-f
/etc/network/interfaces_original
]
;
then
if
!
grep
-q
"#
Hotspot
"
/etc/network/interfaces
;
then
if
!
grep
-q
"#
wifi enabled
"
/etc/network/interfaces
;
then
cp
/etc/network/interfaces /etc/network/interfaces_original
fi
fi
echo
'#
Hotspot
'
>
/etc/network/interfaces
echo
'#
wifi enabled
'
>
/etc/network/interfaces
echo
'auto lo br0'
>>
/etc/network/interfaces
echo
'iface lo inet loopback'
>>
/etc/network/interfaces
echo
''
>>
/etc/network/interfaces
...
...
@@ -139,11 +139,29 @@ function hotspot_on {
function
wifi_wpa2_psk
{
ssid
=
$1
passphrase
=
$2
psk
=
$(
wifi_get_psk
"
$ssid
"
"
$passphrase
"
)
echo
"auto
$WIFI_INTERFACE
"
>
/etc/network/interfaces.d/wifi
echo
"iface
$WIFI_INTERFACE
inet dhcp"
>>
/etc/network/interfaces.d/wifi
echo
" wpa-ssid
$ssid
"
>>
/etc/network/interfaces.d/wifi
echo
" wpa-psk
$psk
"
>>
/etc/network/interfaces.d/wifi
if
[
!
-f
/etc/network/interfaces_original
]
;
then
if
!
grep
-q
"# wifi enabled"
/etc/network/interfaces
;
then
cp
/etc/network/interfaces /etc/network/interfaces_original
fi
fi
echo
'# wifi enabled'
>
/etc/network/interfaces
echo
'auto lo'
>>
/etc/network/interfaces
echo
'iface lo inet loopback'
>>
/etc/network/interfaces
echo
''
>>
/etc/network/interfaces
echo
'allow-hotplug eth0'
>>
/etc/network/interfaces
echo
'iface eth0 inet dhcp'
>>
/etc/network/interfaces
echo
''
>>
/etc/network/interfaces
echo
'allow-hotplug wlan0'
>>
/etc/network/interfaces
echo
'iface wlan0 inet manual'
>>
/etc/network/interfaces
echo
'wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf'
>>
/etc/network/interfaces
echo
''
>>
/etc/network/interfaces
echo
'iface default inet dhcp'
>>
/etc/network/interfaces
wpa_passphrase
"
$ssid
"
"
$passphrase
"
>
/etc/wpa_supplicant/wpa_supplicant.conf
systemctl restart network-manager
}
function
wifi_none
{
...
...
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