btrbk/install.sh

30 lines
573 B
Bash
Raw Normal View History

2022-05-27 16:36:33 +02:00
#!/bin/bash/
instbtrbk() {
install btrbk /usr/local/bin/
2022-05-31 13:47:52 +02:00
install btrbk.conf /etc/btrbk.conf
2022-05-27 16:36:33 +02:00
install -t /etc/systemd/system/ btrbk.service btrbk.timer
2022-05-31 13:47:52 +02:00
systemctl daemon-reload
2022-05-27 16:36:33 +02:00
}
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