Added apt keyrings copy/restore
This commit is contained in:
parent
9a7618655e
commit
018bdb500a
1 changed files with 7 additions and 4 deletions
|
@ -23,6 +23,7 @@ hook_pre() {
|
|||
cp -a /etc/apt/sources.list "$restoreDir/"
|
||||
rsync -avhHi /etc/apt/sources.list.d "$restoreDir/"
|
||||
rsync -avhHi /etc/apt/trusted.gpg.d "$restoreDir/"
|
||||
[[ -d /etc/apt/keyrings ]] && rsync -avhHi /etc/apt/keyrings "$restoreDir/"
|
||||
|
||||
cat > restore.sh <<EOF
|
||||
#!/bin/bash
|
||||
|
@ -46,6 +47,7 @@ dpkg-query -s 'rsync' &>/dev/null || install+=" rsync"
|
|||
dpkg-query -s 'aptitude' &>/dev/null || install+=" aptitude"
|
||||
dpkg-query -s 'borgbackup' &>/dev/null || install+=" borgbackup"
|
||||
dpkg-query -s 'borgmatic' &>/dev/null || install+=" borgmatic"
|
||||
dpkg-query -s 'apt-transport-https' &>/dev/null || install+=" apt-transport-https"
|
||||
|
||||
if [[ -n "\$install" ]]; then
|
||||
apt -y install \$install
|
||||
|
@ -56,6 +58,7 @@ grep ':i386' InstallOnly.list &>/dev/null && dpkg --add-architecture i386
|
|||
cp -a sources.list /etc/apt/sources.list
|
||||
rsync --ignore-existing -raz sources.list.d/ /etc/apt/sources.list.d/
|
||||
rsync --ignore-existing -raz trusted.gpg.d/ /etc/apt/trusted.gpg.d/
|
||||
[[ -d keyrings ]] && rsync --ignore-existing -raz keyrings/ /etc/apt/keyrings/
|
||||
|
||||
apt update
|
||||
|
||||
|
|
Loading…
Reference in a new issue