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
323621bd
Commit
323621bd
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Show current ip address on dynamic dns screen
parent
3455a363
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-installer
+18
-0
18 additions, 0 deletions
src/freedombone-installer
webadmin/EN/dynamicdns_template.html
+2
-0
2 additions, 0 deletions
webadmin/EN/dynamicdns_template.html
with
20 additions
and
0 deletions
src/freedombone-installer
+
18
−
0
View file @
323621bd
...
...
@@ -139,6 +139,14 @@ ICECAST_DIR=/icestream
ICECAST_JINGLES=/jingles
liquidsoap_script=/etc/liquidsoapuser/radio.liq
IPV4_ADDRESS_TEST_DESTINATION='85.214.73.63'
webadmin_ipv4_address=
function get_ipv4_address {
IPv4dev=$(ip route get $IPV4_ADDRESS_TEST_DESTINATION | awk '{for(i=1;i
<
=
NF
;
i
++)
if
($
i
~/
dev
/)
print
$(
i
+1)}')
ip
-o
-f
inet
addr
show
dev
"$
IPv4dev
"
|
awk
'{
print
$4}'
|
awk
'
END
{
print
}'
|
awk
-F
'/'
'{
print
$1}'
}
function
web_admin_background_color
{
if
!
grep
-q
'
WEBADMIN_BACKGROUND_COLOR=
' "/root/${PROJECT_NAME}.cfg"; then
echo '
WEBADMIN_BACKGROUND_COLOR=
white'
>
> "/root/${PROJECT_NAME}.cfg"
...
...
@@ -1848,6 +1856,7 @@ function regenerate_dynamic_dns {
fi
sed -i "s|\"$ddns\"|\"$ddns\" selected|g" "$webadmin_install_dir/dynamicdns.html"
sed -i "s|DDNS_USERNAME|$ddns_username|g" "$webadmin_install_dir/dynamicdns.html"
sed -i "s|CURRENT_IP_ADDRESS|$(get_ipv4_address)|g" "$webadmin_install_dir/dynamicdns.html"
# Note: For security don't populate the password
#sed -i "s|DDNS_PASSWORD|$ddns_password|g" "$webadmin_install_dir/dynamicdns.html"
chown www-data:www-data "$webadmin_install_dir/dynamicdns.html"
...
...
@@ -2590,6 +2599,14 @@ function update_dynamic_dns {
fi
}
function
webadmin_monitor_ip_changes
{
curr_ipv4=
$(get_ipv4_address)
if
[[
"$
curr_ipv4
"
!=
"$
webadmin_ipv4_address
"
]];
then
webadmin_ipv4_address=
$curr_ipv4
update_dynamic_dns
fi
}
function
change_theme
{
if
[
-f
"$
theme_file
"
];
then
bg_color=
$(awk
-F
','
'{
print
$1}'
<
"$
theme_file
")
...
...
@@ -2895,6 +2912,7 @@ do
webadmin_change_password
update_blocklist
update_dynamic_dns
webadmin_monitor_ip_changes
update_system_monitor
change_language
change_theme
...
...
This diff is collapsed.
Click to expand it.
webadmin/EN/dynamicdns_template.html
+
2
−
0
View file @
323621bd
...
...
@@ -127,6 +127,8 @@
<p
class=
"headertext"
translate=
"yes"
>
Dynamic DNS
</p>
<p
class=
"headertext"
translate=
"no"
>
CURRENT_IP_ADDRESS
</p>
<form
action=
"dynamicdns.php"
method=
"post"
>
<select
class=
"ddnslist"
name=
"dynamicdns"
size=
"5"
>
<option
value=
"none"
translate=
"yes"
>
none
</option>
...
...
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