Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DSI Parser Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
DigitalDynamicMeasurement
DSI Parser Frontend
Commits
56d555c2
Commit
56d555c2
authored
10 months ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
tryed opther ip discover methode
parent
3c92ab9b
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
startkBokehAndPrintIp.sh
+22
-5
22 additions, 5 deletions
startkBokehAndPrintIp.sh
with
22 additions
and
5 deletions
startkBokehAndPrintIp.sh
+
22
−
5
View file @
56d555c2
#!/bin/bash
# Find the local IP address. This line gets the IP address associated with the default route.
LOCAL_IP
=
$(
ip route get 1 |
awk
'{print $7;exit}'
)
#!/bin/bash
# Function to print IP addresses using ip command
function
print_ips_with_ip
()
{
echo
"IP addresses on this machine:"
ip
-4
addr show |
grep
-oP
'(?<=inet\s)\d+(\.\d+){3}'
}
# Print the local IP address
echo
"Local IP Address:
$LOCAL_IP
"
# Function to print IP addresses using ifconfig command
function
print_ips_with_ifconfig
()
{
echo
"IP addresses on this machine:"
ifconfig |
grep
-o
'inet addr:\S*'
|
cut
-d
':'
-f2
}
# Check if ip command is available and use it, otherwise try ifconfig
if
command
-v
ip
>
/dev/null 2>&1
;
then
print_ips_with_ip
elif
command
-v
ifconfig
>
/dev/null 2>&1
;
then
print_ips_with_ifconfig
else
echo
"No tool available to find IP addresses."
fi
# Define the initial Bokeh server command
CMD
=(
"bokeh"
"serve"
"dsi-parser-frontend/"
"--port"
"5020"
"--allow-websocket-origin"
"*"
"--use-xheaders"
"--prefix"
"dsi-parser-frontend"
)
...
...
@@ -19,4 +36,4 @@ if [ $EXIT_STATUS -ne 0 ]; then
# Define and execute the fallback Bokeh server command
CMD
=(
"bokeh"
"serve"
"./"
"--port"
"5020"
"--allow-websocket-origin"
"*"
"--use-xheaders"
"--prefix"
"dsi-parser-frontend"
)
"
${
CMD
[@]
}
"
fi
fi
\ No newline at end of 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