Skip to content

Commit 75b6aa9

Browse files
committed
Update build.func
1 parent aab85ab commit 75b6aa9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

misc/build.func

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,9 @@ EOF
10571057
msg_info "Starting LXC Container"
10581058
pct start "$CTID"
10591059
msg_ok "Started LXC Container"
1060+
10601061
msg_info "Customizing LXC Container"
1062+
: "${tz:=Etc/UTC}"
10611063
if [ "$var_os" == "alpine" ]; then
10621064
sleep 3
10631065
pct exec "$CTID" -- /bin/sh -c 'cat <<EOF >/etc/apk/repositories
@@ -1067,21 +1069,23 @@ EOF'
10671069
pct exec "$CTID" -- ash -c "apk add bash newt curl openssh nano mc ncurses >/dev/null"
10681070
else
10691071
sleep 3
1070-
# Set locale and timezone before update
10711072
pct exec "$CTID" -- bash -c "sed -i '/$LANG/ s/^# //' /etc/locale.gen"
10721073
pct exec "$CTID" -- bash -c "locale_line=\$(grep -v '^#' /etc/locale.gen | grep -E '^[a-zA-Z]' | awk '{print \$1}' | head -n 1) && \
10731074
echo LANG=\$locale_line >/etc/default/locale && \
10741075
locale-gen >/dev/null && \
10751076
export LANG=\$locale_line"
10761077

1077-
pct exec "$CTID" -- bash -c "echo $tz >/etc/timezone && ln -sf /usr/share/zoneinfo/$tz /etc/localtime"
1078+
if pct exec "$CTID" -- test -e "/usr/share/zoneinfo/$tz"; then
1079+
pct exec "$CTID" -- bash -c "echo $tz >/etc/timezone && ln -sf /usr/share/zoneinfo/$tz /etc/localtime"
1080+
else
1081+
msg_info "Skipping timezone setup – zone '$tz' not found in container"
1082+
fi
10781083

1079-
# Install curl
10801084
pct exec "$CTID" -- bash -c "apt-get update >/dev/null && apt-get install -y sudo curl mc gnupg2 >/dev/null"
10811085
fi
10821086
msg_ok "Customized LXC Container"
1083-
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/install/$var_install.sh)" $?
10841087

1088+
lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/install/"$var_install".sh)" $?
10851089
}
10861090

10871091
# This function sets the description of the container.

0 commit comments

Comments
 (0)