mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-07-25 06:42:34 -04:00
Add find-your-casaos-ip-and-port
This commit is contained in:
5
find-your-casaos-ip-and-port/README.md
Normal file
5
find-your-casaos-ip-and-port/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Run command
|
||||
|
||||
```bash
|
||||
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/find-your-casaos-ip-and-port/run.sh)"
|
||||
```
|
||||
17
find-your-casaos-ip-and-port/run.sh
Normal file
17
find-your-casaos-ip-and-port/run.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Path to the configuration file
|
||||
CONFIG_FILE="/etc/casaos/gateway.ini"
|
||||
|
||||
# Check if the configuration file exists
|
||||
if [[ -f $CONFIG_FILE ]]; then
|
||||
# Use grep to find the line with 'port' and use awk to print the value
|
||||
PORT=$(grep '^port=' $CONFIG_FILE | awk -F'=' '{print $2}')
|
||||
# Get the local IP address
|
||||
IP_ADDR=$(hostname -I | awk '{print $1}')
|
||||
echo "The local IP address is: $IP_ADDR"
|
||||
echo "The port number is: $PORT"
|
||||
echo "You can access it in the browser at: http://$IP_ADDR:$PORT"
|
||||
else
|
||||
echo "Error: Configuration file not found."
|
||||
fi
|
||||
Reference in New Issue
Block a user