borgmatic-base/scripts/os_solus

30 lines
434 B
Text
Raw Normal View History

2021-09-04 09:17:00 -04:00
#!/bin/bash
restoreDir="/etc/restore"
hook_check() {
if [[ -d "$restoreDir" ]]; then
rm -rf "$restoreDir" || exit 1
fi
}
hook_pre() {
mkdir -p "$restoreDir" || exit 1
pushd "$restoreDir" || exit 2
eopkg li > Packages.list
popd || exit 2
}
hook_post() {
rm -rf "$restoreDir"
}
case "$1" in
before_check) hook_check;;
before_backup) hook_pre;;
after_backup) hook_post;;
esac