-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallation.sh
More file actions
executable file
·71 lines (63 loc) · 1.97 KB
/
installation.sh
File metadata and controls
executable file
·71 lines (63 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
echo
if command -v restic &>/dev/null; then
echo "restic is already installed, updating..."
restic self-update
else
echo "Installing restic..."
get_latest_restic_url() {
curl -s https://api.github.com/repos/restic/restic/releases/latest | grep "browser_download_url.*linux_amd64.bz2" | cut -d '"' -f 4
}
restic_url=$(get_latest_restic_url)
curl -L $restic_url -o restic.bz2
bzip2 -d restic.bz2
chmod +x restic
mkdir -p ~/bin
mv restic ~/bin/
echo 'export PATH=$HOME/bin:$PATH' >>~/.bashrc
source ~/.bashrc
restic version
fi
echo
if command -v resticprofile &>/dev/null; then
echo "resticprofile is already installed, updating..."
resticprofile self-update
else
echo "Installing resticprofile..."
get_latest_resticprofile_url() {
curl -s https://api.github.com/repos/creativeprojects/resticprofile/releases/latest | grep "browser_download_url.*linux_amd64.tar.gz" | head -n 1 | cut -d '"' -f 4
}
resticprofile_url=$(get_latest_resticprofile_url)
curl -L $resticprofile_url -o resticprofile.tar.gz
tar -xzf resticprofile.tar.gz
chmod +x resticprofile
mkdir -p ~/bin
mv resticprofile ~/bin/
echo 'export PATH=$HOME/bin:$PATH' >>~/.bashrc
source ~/.bashrc
resticprofile version
fi
echo
if command -v rclone &>/dev/null; then
echo "rclone is already installed, updating..."
rclone self-update
else
echo "Installing rclone..."
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
rm rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
mv rclone ~/bin/
cd ..
rm -rf rclone-*-linux-amd64
echo 'export PATH=$HOME/bin:$PATH' >>~/.bashrc
source ~/.bashrc
rclone version
fi
echo
resticprofile generate --random-key >./password-file
echo "Generated secure password for the repository in ./password-file. Please keep this safe!"
echo
cp config.conf.example config.conf
echo "Created example configuration in ./config.conf, please fill this with your own values"
echo