mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-06 04:11:21 -05:00
Compare commits
1 Commits
v5.0.2-rc.
...
install-sh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23c958e53d |
@@ -48,6 +48,7 @@ get_latest_version
|
||||
|
||||
dlversion="${OC_VERSION:-$latest_version}"
|
||||
dlurl="https://github.com/opencloud-eu/opencloud/releases/download/v${dlversion}/"
|
||||
dlurl2="https://github.com/opencloud-eu/opencloud/releases/download/${dlversion}/"
|
||||
|
||||
sandbox="opencloud-sandbox-${dlversion}"
|
||||
|
||||
@@ -74,6 +75,17 @@ fi
|
||||
dlfile="opencloud-${dlversion}-${os}-${dlarch}"
|
||||
|
||||
# download
|
||||
status=$(curl -I -L -o /dev/null -s -w "%{http_code}\n" "$dlurl/$dlfile")
|
||||
if [ "$status" -ne 200 ]; then
|
||||
echo "HTTP code: $status ($dlurl/$dlfile)"
|
||||
dlurl=$dlurl2
|
||||
status=$(curl -I -L -o /dev/null -s -w "%{http_code}\n" "$dlurl2/$dlfile")
|
||||
if [ "$status" -ne 200 ]; then
|
||||
echo "HTTP code: $status ($dlurl/$dlfile)"
|
||||
# exit -1 # or try nevertheless?
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Downloading ${dlurl}/${dlfile}"
|
||||
|
||||
curl -L -o "${dlfile}" --progress-bar "${dlurl}/${dlfile}"
|
||||
@@ -84,12 +96,12 @@ export OC_CONFIG_DIR="$basedir/config"
|
||||
export OC_BASE_DATA_PATH="$basedir/data"
|
||||
mkdir -p "$OC_CONFIG_DIR" "$OC_BASE_DATA_PATH"
|
||||
|
||||
maincfg="$OC_CONFIG_DIR/opencloud.yaml"
|
||||
|
||||
# It is bound to localhost for now to deal with non existing routes
|
||||
# to certain host names for example in WSL
|
||||
host="${OC_HOST:-localhost}"
|
||||
|
||||
./${dlfile} init --insecure yes --ap admin
|
||||
|
||||
echo '#!/bin/bash
|
||||
SCRIPT_DIR="$(dirname "$(readlink -f "${0}")")"
|
||||
cd "${SCRIPT_DIR}"' > runopencloud.sh
|
||||
@@ -108,6 +120,14 @@ export OC_LOG_LEVEL=warning
|
||||
|
||||
chmod 755 runopencloud.sh
|
||||
|
||||
if [ -f "$maincfg" ]; then
|
||||
echo "Main config file $maincfg exists."
|
||||
echo "Skipping initialization. This might be an update from a previous version."
|
||||
echo "To restart the server, refer to the script in $basedir or $basedir/$sandbox"
|
||||
exit 0
|
||||
fi
|
||||
./${dlfile} init --insecure yes --ap admin
|
||||
|
||||
echo "Connect to OpenCloud via https://${host}:9200"
|
||||
echo ""
|
||||
echo "*** This is a fragile test setup, not suitable for production! ***"
|
||||
|
||||
Reference in New Issue
Block a user