-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-install
More file actions
executable file
·47 lines (38 loc) · 1.46 KB
/
post-install
File metadata and controls
executable file
·47 lines (38 loc) · 1.46 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
#!/usr/bin/env bash
set -euo pipefail
# docker
if ! [ $(getent group docker) ]; then
sudo groupadd docker
fi
sudo usermod -aG docker $USER
# cht.sh bash completion
mkdir -p ~/.bash.d
curl https://cheat.sh/:bash_completion > ~/.bash.d/cht.sh
. ~/.bash.d/cht.sh
# and add . ~/.bash.d/cht.sh to ~/.bashrc
# mapMouseButton
sudo modprobe uinput
if ! [ $(getent group logitechgrabber) ]; then
sudo groupadd logitechgrabber
fi
sudo usermod -aG logitechgrabber $USER
# restic completion
sudo restic generate --bash-completion /etc/bash_completion.d/restic
# restic full backup without root https://restic.readthedocs.io/en/stable/080_examples.html#full-backup-without-root
if ! id restic >/dev/null 2>&1; then
sudo useradd --system --create-home --shell /sbin/nologin restic
fi
if ! sudo test -d ~restic/bin; then
sudo mkdir ~restic/bin
fi
sudo sh -c "curl -L https://github.com/restic/restic/releases/download/v0.16.2/restic_0.16.2_linux_amd64.bz2 | bunzip2 > ~restic/bin/restic"
sudo chown root:restic ~restic/bin/restic
sudo chmod 750 ~restic/bin/restic
# you want to run this every time after a restic self-update
sudo setcap cap_dac_read_search=+ep ~restic/bin/restic
# Finally to run a backup with restic as user
# sudo -u restic /home/restic/bin/restic --exclude={/dev,/media,/mnt,/proc,/run,/sys,/tmp,/var/tmp} -r /tmp backup /
# enable syncthing service
systemctl --user enable syncthing.service
systemctl --user start syncthing.service
echo "Finish running post installation"