Fix Linux install script for non-root users (#876)
This commit is contained in:
+15
-1
@@ -29,6 +29,20 @@ then
|
|||||||
abort "This script requires bash"
|
abort "This script requires bash"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if $INSTALL_PATH exists
|
||||||
|
if [ ! -d ${INSTALL_PATH} ]
|
||||||
|
then
|
||||||
|
abort "Could not install, ${INSTALL_PATH} doesn't exist"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Needs SUDO if no permissions to write
|
||||||
|
SUDO_PREFIX=""
|
||||||
|
if [ ! -w ${INSTALL_PATH} ]
|
||||||
|
then
|
||||||
|
SUDO_PREFIX="sudo"
|
||||||
|
log "sudo is required to install to ${INSTALL_PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check cURL is installed
|
# Check cURL is installed
|
||||||
if ! command -v curl >/dev/null
|
if ! command -v curl >/dev/null
|
||||||
then
|
then
|
||||||
@@ -68,6 +82,6 @@ fi
|
|||||||
log "Installing ${REPO} ${VERSION}"
|
log "Installing ${REPO} ${VERSION}"
|
||||||
log "Downloading from ${ARCHIVE_URL}..."
|
log "Downloading from ${ARCHIVE_URL}..."
|
||||||
|
|
||||||
curl -s -L "${ARCHIVE_URL}" | tar xzf - -C "${INSTALL_PATH}" --wildcards --no-anchored "$REPO*"
|
curl -s -L "${ARCHIVE_URL}" | ${SUDO_PREFIX} tar xzf - -C "${INSTALL_PATH}" --wildcards --no-anchored "$REPO*"
|
||||||
|
|
||||||
log "\nlivekit-server is installed to $INSTALL_PATH\n"
|
log "\nlivekit-server is installed to $INSTALL_PATH\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user