diff --git a/check.bash b/check.bash index 6002b3d..b6c63eb 100755 --- a/check.bash +++ b/check.bash @@ -42,7 +42,8 @@ function copy_config() { tmpdir=$(mktemp -d) echo $tmpdir cp -r /etc/ $tmpdir - apt list --installed | awk -F/ '{print $1}' > $tmpdir/installed_packages + #apt list --installed | awk -F/ '{print $1}' > $tmpdir/installed_packages + dpkg --get-selections > $tmpdir/installed_packages # From https://wiki.debian.org/AptCLI#apt-file # dpkg --get-selections >/backup/package-selections # apt install $(cat /backup/package-selections | awk '{print $1}') diff --git a/restore.bash b/restore.bash index a9c607d..271d239 100755 --- a/restore.bash +++ b/restore.bash @@ -1,5 +1,7 @@ #!/bin/bash +set -x + function cprint () { color="$1" shift @@ -32,13 +34,13 @@ function restore_config() { aptpkgfile="installed_packages" # restore apt first - cp -R apt/ /etc + cp -R etc/apt/ /etc apt update apt upgrade -y # now the programs installed via apt before we restore configs apt install -y $(cat $aptpkgfile | awk '{print $1}') # we should be set app wise now the configs - cp -R . /etc + cp -R etc/ /etc # most files in here with me are from /etc