#!/usr/bin/env bash # Install OCIS as systemd set -euo pipefail config="/etc/ocis" # config directory data="/var/lib/ocis" # data directory host="https://ocis.example.com" # Host name # https://download.owncloud.com/ocis/ocis/stable/?sort=time&order=desc version="7.1.3" file_name="ocis-${version}-linux-amd64" file_url="https://download.owncloud.com/ocis/ocis/stable/${version}/${file_name}" apt install -y sudo wget # Requirements sudo wget -P /usr/local/bin ${file_url} # Grab the image from Owncloud sudo chmod a+x /usr/local/bin/${file_name} # Make it executeable sudo ln -s -f /usr/local/bin/${file_name} /usr/local/bin/ocis # Link to it ocis version --skip-services # Show version number # Create user sudo useradd --system --no-create-home --shell=/sbin/nologin ocis # Data Directory sudo mkdir -p ${data} sudo chown -R ocis:ocis ${data} # Config sudo mkdir -p ${config} sudo tee ${config}/ocis.env > /dev/null < ocis-init.txt # Create OCIS Service sudo tee /etc/systemd/system/ocis.service > /dev/null <