btrbk/install.sh

28 lines
514 B
Bash
Raw Normal View History

2022-05-27 16:36:33 +02:00
#!/bin/bash/
instbtrbk() {
install btrbk /usr/local/bin/
install -t /etc/systemd/system/ btrbk.service btrbk.timer
}
instrclone() {
declare -A osInfo;
2022-05-29 12:01:09 +02:00
osInfo[/etc/redhat-release]="dnf -y install rclone"
osInfo[/etc/arch-release]="pacman -Sy --noconfirm rclone"
osInfo[/etc/debian_version]="curl https://rclone.org/install.sh | sudo bash"
2022-05-27 16:36:33 +02:00
for f in ${!osInfo[@]}
do
if [[ -f $f ]];then
2022-05-29 12:01:09 +02:00
${osInfo[$f]}
2022-05-27 16:36:33 +02:00
fi
done
2022-05-29 12:01:09 +02:00
instbtrbk
2022-05-27 16:36:33 +02:00
}
2022-05-29 12:01:09 +02:00
if ! which rclone > /dev/null 2>&1; then
2022-05-27 16:36:33 +02:00
instbtrbk
else
instrclone
fi