#!/bin/bash
set -e

#WORK_DIR='/tmp' && \
WORK_DIR='/var/www/mirror' && \
RCLONE_DEB_F_NAME='rclone-current-linux-amd64.deb' && \
RCLONE_DEB_MIRROR='la.mirrors.naho.moe' && \
RCLONE_DEB_MIRROR_PROTOCOL='https' && \
RCLONE_DEB_REPO='downloads.rclone.org' && \
RCLONE_URI="${RCLONE_DEB_MIRROR_PROTOCOL}://${RCLONE_DEB_MIRROR}/rclone-current-linux-amd64.deb" && \
RCLONE_URI='https://downloads.rclone.org/rclone-current-linux-amd64.deb' && \
cd "${WORK_DIR}" && \
rm -f "${WORKDIR}/${RCLONE_DEB_F_NAME}" &> /dev/null && \
wget -q -4 "${RCLONE_URI}" &>/dev/null && \
dpkg -i rclone-current-linux-amd64.deb &> /dev/null
#dpkg -i rclone-current-linux-amd64.deb &> /dev/null && \
#rm -f "${WORKDIR}/${RCLONE_DEB_F_NAME}" &> /dev/null

