diff --git a/apps/nginx-proxy-manager/install.sh b/apps/nginx-proxy-manager/install.sh index 2987e92..159a749 100644 --- a/apps/nginx-proxy-manager/install.sh +++ b/apps/nginx-proxy-manager/install.sh @@ -1,23 +1,20 @@ #!/usr/bin/env bash EPS_BASE_URL=${EPS_BASE_URL:-} EPS_OS_DISTRO=${EPS_OS_DISTRO:-} -EPS_UTILS=${EPS_UTILS:-} +EPS_UTILS_COMMON=${EPS_UTILS_COMMON:-} +EPS_UTILS_DISTRO=${EPS_UTILS_DISTRO:-} EPS_APP_CONFIG=${EPS_APP_CONFIG:-} EPS_CLEANUP=${EPS_CLEANUP:-false} EPS_CT_INSTALL=${EPS_CT_INSTALL:-false} -if [ -z "$EPS_BASE_URL" -o -z "$EPS_OS_DISTRO" -o -z "$EPS_UTILS" -o -z "$EPS_APP_CONFIG" ]; then +if [ -z "$EPS_BASE_URL" -o -z "$EPS_OS_DISTRO" -o -z "$EPS_UTILS_COMMON" -o -z "$EPS_UTILS_DISTRO" -o -z "$EPS_APP_CONFIG" ]; then printf "Script looded incorrectly!\n\n"; exit 1; fi -source <(echo -n "$EPS_UTILS") +source <(echo -n "$EPS_UTILS_COMMON") +source <(echo -n "$EPS_UTILS_DISTRO") source <(echo -n "$EPS_APP_CONFIG") -if [ "$EPS_OS_DISTRO" = "alpine" ]; then - source <(wget --no-cache -qO- ${EPS_BASE_URL}/utils/alpine.sh) -else - source <(wget --no-cache -qO- ${EPS_BASE_URL}/utils/debian.sh) -fi pms_bootstrap pms_settraps diff --git a/create.sh b/create.sh index c8d26ff..a7cf866 100644 --- a/create.sh +++ b/create.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -export EPS_BASE_URL=https://raw.githubusercontent.com/ej52/proxmox-scripts/main +export EPS_BASE_URL=${EPS_BASE_URL:-https://raw.githubusercontent.com/ej52/proxmox-scripts/main} export EPS_CT_INSTALL=true -export EPS_UTILS=$(wget --no-cache -qO- $EPS_BASE_URL/utils/common.sh) -source <(echo -n "$EPS_UTILS") +export EPS_UTILS_COMMON=$(wget --no-cache -qO- $EPS_BASE_URL/utils/common.sh) +source <(echo -n "$EPS_UTILS_COMMON") pms_bootstrap pms_settraps @@ -190,4 +190,11 @@ step_start "LXC container" "Creating" "Created" step_end "LXC container ${CLR_CYB}$EPS_CT_ID${CLR_GN} created successfully" trap - ERR + +_utilDistro=$EPS_OS_DISTRO +if [ "$EPS_OS_DISTRO" = "ubuntu" ]; then + _utilDistro="debian" +fi + +export EPS_UTILS_DISTRO=$(wget --no-cache -qO- $EPS_BASE_URL/utils/${_utilDistro}.sh) lxc-attach -n $EPS_CT_ID -- bash -c "$EPS_APP_INSTALL" \ No newline at end of file diff --git a/install.sh b/install.sh index ca5a9d5..45edf27 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -export EPS_BASE_URL=https://raw.githubusercontent.com/ej52/proxmox-scripts/main +export EPS_BASE_URL=${EPS_BASE_URL:-https://raw.githubusercontent.com/ej52/proxmox-scripts/main} export EPS_CT_INSTALL=false CLR_RD="\033[0;31m" @@ -54,6 +54,12 @@ if [ "$EPS_OS_DISTRO" = "alpine" ]; then [ "$(command -v bash)" ] || apk add bash >/dev/null fi -export EPS_UTILS=$(wget --no-cache -qO- $EPS_BASE_URL/utils/common.sh) +_utilDistro=$EPS_OS_DISTRO +if [ "$EPS_OS_DISTRO" = "ubuntu" ]; then + _utilDistro="debian" +fi + +export EPS_UTILS_COMMON=$(wget --no-cache -qO- $EPS_BASE_URL/utils/common.sh) +export EPS_UTILS_DISTRO=$(wget --no-cache -qO- $EPS_BASE_URL/utils/${_utilDistro}.sh) bash -c "$EPS_APP_INSTALL"