installer: better variable name
This commit is contained in:
@@ -64,14 +64,14 @@ readonly box_src_dir=/home/${user}/box
|
||||
|
||||
readonly curl="curl --fail --connect-timeout 20 --retry 10 --retry-delay 2 --max-time 2400"
|
||||
readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly box_src_tmp_dir="$(realpath ${script_dir}/..)"
|
||||
readonly box_src_next_dir="$(realpath ${script_dir}/..)"
|
||||
|
||||
readonly ubuntu_version=$(lsb_release -rs)
|
||||
readonly ubuntu_codename=$(lsb_release -cs)
|
||||
|
||||
readonly is_update=$(systemctl is-active -q box && echo "yes" || echo "no")
|
||||
|
||||
log "Updating from $(cat $box_src_dir/VERSION 2>/dev/null) to $(cat $box_src_tmp_dir/VERSION 2>/dev/null)"
|
||||
log "Updating from $(cat $box_src_dir/VERSION 2>/dev/null) to $(cat $box_src_next_dir/VERSION 2>/dev/null)"
|
||||
|
||||
if [[ "${ubuntu_version}" == "18.04" ]]; then
|
||||
log "This Cloudron version requires atleast Ubuntu 20.04. Please upgrade following https://docs.cloudron.io/guides/upgrade-ubuntu-20/"
|
||||
@@ -146,13 +146,13 @@ for try in `seq 1 10`; do
|
||||
# We need --unsafe-perm as we run as root and the folder is owned by root,
|
||||
# however by default npm drops privileges for npm rebuild
|
||||
# https://docs.npmjs.com/misc/config#unsafe-perm
|
||||
if cd "${box_src_tmp_dir}" && npm rebuild --unsafe-perm; then break; fi
|
||||
if cd "${box_src_next_dir}" && npm rebuild --unsafe-perm; then break; fi
|
||||
log "Failed to rebuild, trying again"
|
||||
sleep 5
|
||||
done
|
||||
|
||||
# update TLDs rules.json (https://github.com/thom4parisot/tld.js?tab=readme-ov-file#updating-the-tlds-list)
|
||||
if ! node "${box_src_tmp_dir}/node_modules/tldjs/bin/update.js"; then
|
||||
if ! node "${box_src_next_dir}/node_modules/tldjs/bin/update.js"; then
|
||||
log "Failed to update PSL, continue anyway"
|
||||
fi
|
||||
|
||||
@@ -162,7 +162,7 @@ if [[ ${try} -eq 10 ]]; then
|
||||
fi
|
||||
|
||||
log "downloading new addon images"
|
||||
images=$(node -e "const i = require('${box_src_tmp_dir}/src/infra_version.js'); console.log(Object.keys(i.images).map(x => i.images[x]).join(' '));")
|
||||
images=$(node -e "const i = require('${box_src_next_dir}/src/infra_version.js'); console.log(Object.keys(i.images).map(x => i.images[x]).join(' '));")
|
||||
|
||||
# docker hub only uses first 64 bits for ipv6 addressing. this causes many ipv6 rate limit errors
|
||||
# https://www.docker.com/blog/beta-ipv6-support-on-docker-hub-registry/
|
||||
@@ -198,7 +198,7 @@ cd /root
|
||||
|
||||
log "switching the box code"
|
||||
rm -rf "${box_src_dir}"
|
||||
mv "${box_src_tmp_dir}" "${box_src_dir}"
|
||||
mv "${box_src_next_dir}" "${box_src_dir}"
|
||||
chown -R "${user}:${user}" "${box_src_dir}"
|
||||
|
||||
log "calling box setup script"
|
||||
|
||||
Reference in New Issue
Block a user