mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 11:50:06 +00:00
Fix ip import (#10964)
* Rename import_local_ip to get_local_ip Replaces all references to the helper function import_local_ip with get_local_ip across scripts and documentation for consistency. Updates usage examples and comments to reflect the new function name. * Rename get_local_ip to get_lxc_ip and update usage Replaces all references to get_local_ip with get_lxc_ip across scripts, documentation, and templates for clarity and consistency. Updates the implementation in core.func to improve IP detection for LXC containers, and adjusts helper functions in addon scripts accordingly.
This commit is contained in:
parent
38a0757e4e
commit
d6811a3383
10 changed files with 36 additions and 19 deletions
|
|
@ -303,7 +303,7 @@ UPDATEEOF
|
|||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
get_lxc_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function msg_info() { echo -e "${INFO} ${YW}$1...${CL}"; }
|
|||
function msg_ok() { echo -e "${CM} ${GN}$1${CL}"; }
|
||||
function msg_error() { echo -e "${CROSS} ${RD}$1${CL}"; }
|
||||
|
||||
get_local_ip() {
|
||||
get_lxc_ip() {
|
||||
if command -v hostname >/dev/null 2>&1 && hostname -I 2>/dev/null; then
|
||||
hostname -I | awk '{print $1}'
|
||||
elif command -v ip >/dev/null 2>&1; then
|
||||
|
|
@ -39,7 +39,7 @@ get_local_ip() {
|
|||
echo "127.0.0.1"
|
||||
fi
|
||||
}
|
||||
IP=$(get_local_ip)
|
||||
IP=$(get_lxc_ip)
|
||||
|
||||
install_glances_debian() {
|
||||
msg_info "Installing dependencies"
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ if [[ "${type:-}" == "update" ]]; then
|
|||
fi
|
||||
|
||||
header_info
|
||||
import_local_ip
|
||||
get_lxc_ip
|
||||
|
||||
# Check if already installed
|
||||
if [[ -d "$INSTALL_PATH" && -f "$INSTALL_PATH/package.json" ]]; then
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ UPDATEEOF
|
|||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
get_lxc_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ UPDATEEOF
|
|||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
get_lxc_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ UPDATEEOF
|
|||
# ==============================================================================
|
||||
header_info
|
||||
ensure_usr_local_bin_persist
|
||||
import_local_ip
|
||||
get_lxc_ip
|
||||
|
||||
# Handle type=update (called from update script)
|
||||
if [[ "${type:-}" == "update" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue