From 3dd017e1d50082757898c5e6a591363feb980566 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 2 Apr 2023 04:20:37 +0200 Subject: [PATCH] Add a separate script for configuring rclone --- scripts/Common/Config/rclone/install.sh | 2 ++ .../Software => Common/Config}/rclone/rclone@.service | 0 scripts/Debian/Software/rclone/install.sh | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 scripts/Common/Config/rclone/install.sh rename scripts/{Debian/Software => Common/Config}/rclone/rclone@.service (100%) diff --git a/scripts/Common/Config/rclone/install.sh b/scripts/Common/Config/rclone/install.sh new file mode 100755 index 00000000..5e8acc90 --- /dev/null +++ b/scripts/Common/Config/rclone/install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +sudo cp "${BASH_SOURCE%/*}/rclone@.service" /etc/systemd/user; diff --git a/scripts/Debian/Software/rclone/rclone@.service b/scripts/Common/Config/rclone/rclone@.service similarity index 100% rename from scripts/Debian/Software/rclone/rclone@.service rename to scripts/Common/Config/rclone/rclone@.service diff --git a/scripts/Debian/Software/rclone/install.sh b/scripts/Debian/Software/rclone/install.sh index ad361b0b..18465452 100755 --- a/scripts/Debian/Software/rclone/install.sh +++ b/scripts/Debian/Software/rclone/install.sh @@ -1,13 +1,16 @@ #!/bin/bash # Elevate script +pushd "${BASH_SOURCE%/*}" > /dev/null; + if [ ! "$UID" -eq 0 ] then sudo bash "$BASH_SOURCE"; + source "../../../Common/Config/rclone/install.sh"; 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 + +popd;