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
54b3daf9
Commit
54b3daf9
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Default to no static local IP address, but have the option to set one
parent
6227eb6f
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
+9
-2
9 additions, 2 deletions
src/freedombone
src/freedombone-config
+44
-29
44 additions, 29 deletions
src/freedombone-config
with
53 additions
and
31 deletions
src/freedombone
+
9
−
2
View file @
54b3daf9
...
...
@@ -101,7 +101,8 @@ CPU_CORES=1
IPV6_NETWORK='2001:470:26:307'
# The static IP address of the system within the local network
LOCAL_NETWORK_STATIC_IP_ADDRESS="192.168.1.60"
# By default the IP address is dynamic within your LAN
LOCAL_NETWORK_STATIC_IP_ADDRESS=
# IP address of the router (gateway)
ROUTER_IP_ADDRESS="192.168.1.254"
...
...
@@ -1291,6 +1292,9 @@ function install_not_on_BBB {
if [[ INSTALLING_ON_BBB == "yes" ]]; then
return
fi
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
return
fi
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
...
...
@@ -6975,7 +6979,10 @@ function configure_email {
echo "dc_readhost=''" >> /etc/exim4/update-exim4.conf.conf
echo "dc_relay_domains=''" >> /etc/exim4/update-exim4.conf.conf
echo "dc_minimaldns='false'" >> /etc/exim4/update-exim4.conf.conf
RELAY_NETS=$(echo $LOCAL_NETWORK_STATIC_IP_ADDRESS | awk -F '.' '{print $1 "." $2 "." $3 ".0/24"}')
RELAY_NETS='192.168.1.0/24'
if [ $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then
RELAY_NETS=$(echo $LOCAL_NETWORK_STATIC_IP_ADDRESS | awk -F '.' '{print $1 "." $2 "." $3 ".0/24"}')
fi
echo "dc_relay_nets='$RELAY_NETS'" >> /etc/exim4/update-exim4.conf.conf
echo "dc_smarthost=''" >> /etc/exim4/update-exim4.conf.conf
echo "CFILEMODE='644'" >> /etc/exim4/update-exim4.conf.conf
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-config
+
44
−
29
View file @
54b3daf9
...
...
@@ -180,8 +180,10 @@ function save_configuration_file {
echo
"MY_NAME=
$MY_NAME
"
>>
$CONFIGURATION_FILE
fi
echo
"MY_EMAIL_ADDRESS=
$MY_EMAIL_ADDRESS
"
>>
$CONFIGURATION_FILE
echo
"LOCAL_NETWORK_STATIC_IP_ADDRESS=
$LOCAL_NETWORK_STATIC_IP_ADDRESS
"
>>
$CONFIGURATION_FILE
echo
"ROUTER_IP_ADDRESS=
$ROUTER_IP_ADDRESS
"
>>
$CONFIGURATION_FILE
if
[
$LOCAL_NETWORK_STATIC_IP_ADDRESS
]
;
then
echo
"LOCAL_NETWORK_STATIC_IP_ADDRESS=
$LOCAL_NETWORK_STATIC_IP_ADDRESS
"
>>
$CONFIGURATION_FILE
echo
"ROUTER_IP_ADDRESS=
$ROUTER_IP_ADDRESS
"
>>
$CONFIGURATION_FILE
fi
if
[
$ENABLE_CJDNS
]
;
then
echo
"ENABLE_CJDNS=
$ENABLE_CJDNS
"
>>
$CONFIGURATION_FILE
fi
...
...
@@ -657,10 +659,10 @@ function interactive_configuration {
fi
if
[
-d
/home/
$GENERIC_IMAGE_USERNAME
]
;
then
if
[
!
-f
$IMAGE_PASSWORD_FILE
]
;
then
echo
'Cannot find the password file for the admin user'
exit
62753
fi
if
[
!
-f
$IMAGE_PASSWORD_FILE
]
;
then
echo
'Cannot find the password file for the admin user'
exit
62753
fi
# when installing from an image which comes with a known default user account
selected_username
=
while
[
!
$selected_username
]
...
...
@@ -1091,34 +1093,47 @@ function interactive_configuration {
save_configuration_file
fi
if
[
!
$LOCAL_NETWORK_STATIC_IP_ADDRESS
]
;
then
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
$(
grep
'LOCAL_NETWORK_STATIC_IP_ADDRESS'
temp.cfg |
awk
-F
'='
'{print $2}'
)
SET_STATIC_IP
=
"no"
dialog
--title
$"Static local IP address"
\
--backtitle
$"Freedombone Configuration"
\
--defaultno
\
--yesno
$"
\n
Do you want to set a static local IP address for this system?
\n\n
For example, 192.168.1.10"
10 60
sel
=
$?
case
$sel
in
0
)
SET_STATIC_IP
=
"yes"
;;
255
)
exit
1
;;
esac
if
[[
$SET_STATIC_IP
==
"yes"
]]
;
then
if
[
!
$LOCAL_NETWORK_STATIC_IP_ADDRESS
]
;
then
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
'192.168..'
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
$(
grep
'LOCAL_NETWORK_STATIC_IP_ADDRESS'
temp.cfg |
awk
-F
'='
'{print $2}'
)
if
[
!
$LOCAL_NETWORK_STATIC_IP_ADDRESS
]
;
then
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
'192.168..'
fi
fi
fi
if
[
!
$ROUTER_IP_ADDRESS
]
;
then
ROUTER_IP_ADDRESS
=
$(
grep
'ROUTER_IP_ADDRESS'
temp.cfg |
awk
-F
'='
'{print $2}'
)
if
[
!
$ROUTER_IP_ADDRESS
]
;
then
ROUTER_IP_ADDRESS
=
'192.168..'
ROUTER_IP_ADDRESS
=
$(
grep
'ROUTER_IP_ADDRESS'
temp.cfg |
awk
-F
'='
'{print $2}'
)
if
[
!
$ROUTER_IP_ADDRESS
]
;
then
ROUTER_IP_ADDRESS
=
'192.168..'
fi
fi
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
$"Freedombone Configuration"
\
--title
$"Local Network Configuration"
\
--form
$"
\n
Please enter the IP addresses:"
11 55 3
\
$"This system:"
1 1
"
$LOCAL_NETWORK_STATIC_IP_ADDRESS
"
1 16 16 15
\
$"Internet router:"
2 1
"
$ROUTER_IP_ADDRESS
"
2 16 16 15
\
2>
$data
sel
=
$?
case
$sel
in
1
)
exit
1
;;
255
)
exit
1
;;
esac
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
$(
cat
$data
|
sed
-n
1p
)
ROUTER_IP_ADDRESS
=
$(
cat
$data
|
sed
-n
2p
)
save_configuration_file
fi
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--backtitle
$"Freedombone Configuration"
\
--title
$"Local Network Configuration"
\
--form
$"
\n
Please enter the IP addresses:"
11 55 3
\
$"This system:"
1 1
"
$LOCAL_NETWORK_STATIC_IP_ADDRESS
"
1 16 16 15
\
$"Internet router:"
2 1
"
$ROUTER_IP_ADDRESS
"
2 16 16 15
\
2>
$data
sel
=
$?
case
$sel
in
1
)
exit
1
;;
255
)
exit
1
;;
esac
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
$(
cat
$data
|
sed
-n
1p
)
ROUTER_IP_ADDRESS
=
$(
cat
$data
|
sed
-n
2p
)
save_configuration_file
if
[[
$SYSTEM_TYPE
==
"
$VARIANT_WRITER
"
||
$SYSTEM_TYPE
==
"
$VARIANT_FULL
"
]]
;
then
WIKI_DETAILS_COMPLETE
=
...
...
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