#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
    sudo bash "$BASH_SOURCE";
else
    package="$(mktemp)";
    wget https://github.com/rclone/rclone/releases/download/v1.60.0/rclone-v1.60.0-linux-amd64.deb -O "$package";
    dpkg -i "$package";
    rm -f "$package";

    cp "${BASH_SOURCE%/*}/rclone@.service" /etc/systemd/user;
fi