diff --git a/scripts/os_debian b/scripts/os_debian index 7908436..53b21d6 100755 --- a/scripts/os_debian +++ b/scripts/os_debian @@ -2,9 +2,15 @@ restoreDir="/etc/restore" +function is_bin_in_path { + builtin type -P "$1" &>/dev/null +} hook_check() { - : + if ! is_bin_in_path aptitude; then + echo "aptitude needs to be installed for backups to work properly." + exit 1 + fi } hook_pre() { @@ -14,7 +20,9 @@ hook_pre() { dpkg --get-selections > Package.list aptitude search --disable-columns -F%p '~i!~M!~v' > InstallOnly.list #apt-key exportall > /etc/restore/Repo.keys - rsync -avhHi /etc/apt/trusted.gpg.d /etc/restore/ + cp -a /etc/apt/sources.list "$restoreDir/" + rsync -avhHi /etc/apt/sources.list.d "$restoreDir/" + rsync -avhHi /etc/apt/trusted.gpg.d "$restoreDir/" cat > restore.sh <