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
ae4f3662
Commit
ae4f3662
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Can go back to using a dynamic IP address
parent
33c99281
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-controlpanel
+32
-0
32 additions, 0 deletions
src/freedombone-controlpanel
with
32 additions
and
0 deletions
src/freedombone-controlpanel
+
32
−
0
View file @
ae4f3662
...
...
@@ -1256,6 +1256,37 @@ function change_system_name {
esac
}
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"
\
--yesno
$"
\n
Do you wish to go back to using a dynamic IP address?"
8 60
sel
=
$?
case
$sel
in
0
)
revert_to_dynamic
=
1
;;
esac
if
[
$revert_to_dynamic
]
;
then
remove_config_param
"NETWORK_IS_STATIC"
if
[
-f
/etc/network/interfaces_original
]
;
then
cp
/etc/network/interfaces_original /etc/network/interfaces
fi
clear
echo
''
echo
$'Changing to a dynamic IP address.'
echo
''
echo
$"System is rebooting. You may need to close this terminal and log in from a new one."
reboot
fi
}
function
set_static_IP
{
IPv4_address
=
$(
get_ipv4_address
)
IPv4_address_base
=
$(
echo
"
$IPv4_address
"
|
awk
-F
'.'
'{print $1"."$2"."$3}'
)
...
...
@@ -1280,6 +1311,7 @@ Enter a static local IP address for this system.\n\nIt will typically be ${IPv4_
case
$sel
in
0
)
NEW_STATIC_IP
=
$(
<
$data
)
if
[[
"
$NEW_STATIC_IP
"
!=
*
"."
*
]]
;
then
set_dynamic_IP
return
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