Added flatpak system-wide packages backup/restore
This commit is contained in:
parent
b43335b5c4
commit
2f4e9c280b
1 changed files with 38 additions and 0 deletions
38
scripts/flatpak
Normal file
38
scripts/flatpak
Normal file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
hook_check() {
|
||||
:
|
||||
}
|
||||
|
||||
hook_pre() {
|
||||
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_post() {
|
||||
:
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
before_check) hook_check;;
|
||||
before_backup) hook_pre;;
|
||||
after_backup) hook_post;;
|
||||
esac
|
Loading…
Reference in a new issue