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
d32ada32
Commit
d32ada32
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Setting static IP with wifi
parent
b068fa94
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-controlpanel
+18
-7
18 additions, 7 deletions
src/freedombone-controlpanel
src/freedombone-utils-wifi
+13
-0
13 additions, 0 deletions
src/freedombone-utils-wifi
with
31 additions
and
7 deletions
src/freedombone-controlpanel
+
18
−
7
View file @
d32ada32
...
...
@@ -1203,12 +1203,6 @@ function change_system_name {
}
function
set_dynamic_IP
{
NETWORK_IS_STATIC
=
0
read_config_param
"NETWORK_IS_STATIC"
if
[
${
NETWORK_IS_STATIC
}
-eq
0
]
;
then
return
fi
revert_to_dynamic
=
dialog
--title
$"Return to using a dynamic IP address"
\
--backtitle
$"Freedombone Control Panel"
\
...
...
@@ -1293,8 +1287,22 @@ Enter a static local IP address for this system.\n\nIt will typically be ${IPv4_
email_change_relay
"
$NEW_STATIC_IP
"
if
[[
$(
config_param_exists
"WIFI_INTERFACE"
)
==
"0"
]]
;
then
static_wifi_address
=
if
[[
$(
config_param_exists
"WIFI_INTERFACE"
)
==
"1"
]]
;
then
dialog
--title
$"Static local IP address"
\
--backtitle
$"Freedombone Control Panel"
\
--yesno
$"
\n
Set a static address for the wifi adapter?
\n\n
If you select 'no' then wired ethernet will be used."
10 60
sel
=
$?
case
$sel
in
0
)
static_wifi_address
=
1
write_config_param
"NETWORK_IS_STATIC"
"1"
;;
esac
fi
if
[
!
$static_wifi_address
]
;
then
# wired network
remove_wifi_startup_script
echo
'# This file describes the network interfaces available on your system'
>
/etc/network/interfaces
echo
'# and how to activate them. For more information, see interfaces(5).'
>>
/etc/network/interfaces
echo
''
>>
/etc/network/interfaces
...
...
@@ -1330,6 +1338,9 @@ Enter a static local IP address for this system.\n\nIt will typically be ${IPv4_
echo
'# netmask 255.255.255.0'
>>
/etc/network/interfaces
echo
'# network 192.168.7.0'
>>
/etc/network/interfaces
echo
'# gateway 192.168.7.1'
>>
/etc/network/interfaces
else
# wifi network
wifi_settings
fi
clear
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-wifi
+
13
−
0
View file @
d32ada32
...
...
@@ -573,6 +573,19 @@ function count_wlan {
echo
$ctr
}
function
remove_wifi_startup_script
{
remove_config_param
"WIFI_INTERFACE"
systemd_file
=
/etc/systemd/system/wifistart.service
if
[
-f
$systemd_file
]
;
then
systemctl stop wifistart
systemctl disable wifistart
rm
$systemd_file
fi
if
[
-f
$HOME
/
${
PROJECT_NAME
}
-wifi
.cfg
]
;
then
rm
$HOME
/
${
PROJECT_NAME
}
-wifi
.cfg
fi
}
function
create_wifi_startup_script
{
systemd_file
=
/etc/systemd/system/wifistart.service
echo
'[Unit]'
>
$systemd_file
...
...
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