mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-04-05 09:04:07 -04:00
This commit refactors all the shell scripts to use `#!/usr/bin/env bash` instead of `#!/bin/bash`. This change ensures that the scripts will run with the system's default Bash interpreter, even if it is not located at the standard `/bin/bash` path.
18 lines
589 B
Bash
18 lines
589 B
Bash
#!/usr/bin/env 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
|