]> code.delx.au - monosys/blob - bsnap-borg.install
a0525adcd825e8c704daa309315ce8ac86b16843
[monosys] / bsnap-borg.install
1 #! bash
2
3 function post_install {
4 if grep -q "SECRET" /etc/borg/root/env; then
5 echo ">>> Generating passphrase for /etc/borg/root/env"
6 BORG_PASSPHRASE="$(dd if=/dev/urandom of=/dev/stdout bs=1 count=15 2>/dev/null | base64)"
7 sed -i "s|SECRET|$BORG_PASSPHRASE|" "${pkgdir}/etc/borg/root/env"
8 fi
9
10 if ! systemctl is-enabled backup.timer > /dev/null; then
11 echo ">>> You should run: systemctl enable backup.timer"
12 fi
13 }