Created
May 26, 2018 10:37
-
-
Save KillerGoldFisch/00c4b3fb511642fcb490ccb540a9a35a to your computer and use it in GitHub Desktop.
Install headless Duplicati on Ubuntu 16.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
| echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | tee /etc/apt/sources.list.d/mono-official.list | |
| apt-get update | |
| apt-get -y install ufw unzip mono-devel | |
| mkdir /usr/lib/duplicati | |
| cd /usr/lib/duplicati | |
| wget https://github.com/duplicati/duplicati/releases/download/v2.0.3.3-2.0.3.3_beta_2018-04-02/duplicati-2.0.3.3_beta_2018-04-02.zip | |
| unzip duplicati-2.0.3.3_beta_2018-04-02.zip | |
| rm duplicati-2.0.3.3_beta_2018-04-02.zip | |
| cat <<"TAGTEXTFILE" > /usr/bin/duplicati-cli | |
| #!/bin/bash | |
| INSTALLDIR=/usr/lib/duplicati | |
| export LD_LIBRARY_PATH="${INSTALLDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | |
| export MONO_PATH=$MONO_PATH:${INSTALLDIR} | |
| EXE_FILE=${INSTALLDIR}/Duplicati.CommandLine.exe | |
| APP_NAME=Duplicati.CommandLine | |
| exec -a "$APP_NAME" mono "$EXE_FILE" "$@" | |
| TAGTEXTFILE | |
| cat <<"TAGTEXTFILE" > /usr/bin/duplicati-server | |
| #!/bin/bash | |
| INSTALLDIR=/usr/lib/duplicati | |
| export LD_LIBRARY_PATH="${INSTALLDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | |
| export MONO_PATH=$MONO_PATH:${INSTALLDIR} | |
| EXE_FILE=${INSTALLDIR}/Duplicati.Server.exe | |
| APP_NAME=DuplicatiServer | |
| exec -a "$APP_NAME" mono "$EXE_FILE" "$@" | |
| TAGTEXTFILE | |
| chmod 755 /usr/bin/duplicati-cli | |
| chmod 755 /usr/bin/duplicati-server | |
| cat <<"TAGTEXTFILE" > /etc/default/duplicati | |
| # Defaults for duplicati initscript | |
| # sourced by /etc/init.d/duplicati | |
| # | |
| # This is a POSIX shell fragment | |
| # | |
| # Additional options that are passed to the Daemon. | |
| DAEMON_OPTS="--webservice-port=8200 --webservice-interface=any" | |
| TAGTEXTFILE | |
| cat <<"TAGTEXTFILE" > /etc/systemd/system/duplicati.service | |
| [Unit] | |
| Description=Duplicati web-server | |
| After=network.target | |
| [Service] | |
| EnvironmentFile=-/etc/default/duplicati | |
| ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS | |
| [Install] | |
| WantedBy=multi-user.target | |
| TAGTEXTFILE | |
| systemctl enable duplicati | |
| cat <<"TAGTEXTFILE" > /etc/systemd/system/[email protected] | |
| [Unit] | |
| Description=Duplicati web-server | |
| After=network.target | |
| [Service] | |
| User=%I | |
| EnvironmentFile=-/etc/default/duplicati | |
| ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS | |
| [Install] | |
| WantedBy=multi-user.target | |
| TAGTEXTFILE | |
| # systemctl enable duplicati@vm | |
| ufw allow 8200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment