resticprofiles-base/scripts/flatpak

45 lines
738 B
Bash
Executable file

#!/bin/bash
restoreDir="/etc/restore"
hook_before() {
mkdir -p "$restoreDir" || exit 1
pushd "$restoreDir" || exit 2
which flatpak || exit 0
flatpak list --columns=application --app > flatpaks.lst
cat > restore-flatpak.sh <<EOF
#!/bin/bash
if [[ ! -f "flatpaks.lst" ]]; then
echo "This needs to be run inside the restore directory."
exit 1
fi
which flatpak || exit 0
xargs flatpak install -y < flatpaks.lst
EOF
popd || exit 2
}
hook_after() {
:
}
hook_fail() {
:
}
hook_final() {
:
}
case "$1" in
before) hook_before || exit $?;;
after) hook_after || exit $?;;
fail) hook_fail || exit $?;;
finally) hook_final || exit $?;;
esac