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
e2a66001
Commit
e2a66001
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Show IP addresses on control panel about screen
parent
3141e45f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-app-pihole
+2
-3
2 additions, 3 deletions
src/freedombone-app-pihole
src/freedombone-controlpanel
+9
-0
9 additions, 0 deletions
src/freedombone-controlpanel
src/freedombone-utils-network
+9
-0
9 additions, 0 deletions
src/freedombone-utils-network
with
20 additions
and
3 deletions
src/freedombone-app-pihole
+
2
−
3
View file @
e2a66001
...
...
@@ -66,9 +66,8 @@ function pihole_update {
return
fi
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i
<
=
NF
;
i
++)
if
($
i
~/
dev
/)
print
$(
i
+1)}')
IPv4_address=
$(ip
-o
-f
inet
addr
show
dev
"$
IPv4dev
"
|
awk
'{
print
$4}'
|
awk
'
END
{
print
}')
IPv6_address=
$(ip
-6
route
get
2001
:4860:4860::8888
|
awk
-F
"
"
'{
for(i=
1;i<=NF;i++)
if
($
i =
=
"
src
")
print
$(
i
+1)
}')
IPv4_address=$(get_ipv4_address)
IPv6_address=$(get_ipv6_address)
setupVars=$piholeDir/setupVars.conf
echo "piholeInterface=${PIHOLE_IFACE}" > ${setupVars}
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-controlpanel
+
9
−
0
View file @
e2a66001
...
...
@@ -371,8 +371,17 @@ function show_tahoe_introducer {
echo
''
}
function
show_ip_addresses
{
echo
'IP/DNS addresses'
echo
'================'
echo
''
echo
"IPv4:
$(
get_ipv4_address
)
IPv6:
$(
get_ipv6_address
)
"
echo
''
}
function
show_about
{
clear
show_ip_addresses
show_domains
show_mirrors_password
show_tahoe_introducer
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-network
+
9
−
0
View file @
e2a66001
...
...
@@ -87,4 +87,13 @@ function install_static_network {
mark_completed
$FUNCNAME
}
function
get_ipv4_address
{
IPv4dev
=
$(
ip route get 8.8.8.8 |
awk
'{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}'
)
echo
$(
ip
-o
-f
inet addr show dev
"
$IPv4dev
"
|
awk
'{print $4}'
|
awk
'END {print}'
)
}
function
get_ipv6_address
{
echo
$(
ip
-6
route get 2001:4860:4860::8888 |
awk
-F
" "
'{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }'
)
}
# NOTE: deliberately no exit 0
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