diff --git a/restore.deb.bash b/restore.deb.bash index e43a381..7383f77 100755 --- a/restore.deb.bash +++ b/restore.deb.bash @@ -37,7 +37,16 @@ function restore_config() { if [ -f ./exclusions ]; then exclusions # this runs exclusions fi + # Novel idea but not good for errors: apt install -y $(cat $aptpkgfile | awk '{print $1}') apt install -y $(cat $aptpkgfile | awk '{print $1}') + # check for error + + if [ $? -ne 0 ]; then + cat installed_packages | awk '{print $1}' | while read -r package; do + apt install -y $package + done + fi + # we should be set app wise now the configs cp -R etc/ /etc cprint 3 "You may want to reboot for changes to take effect" diff --git a/test.bash b/test.bash index da3d5e6..a5380e1 100755 --- a/test.bash +++ b/test.bash @@ -1,12 +1,17 @@ #!/bin/bash -source ./os_probe.bash +aptpkgfile="installed_packages" +apt install -s -y $(cat $aptpkgfile | awk '{print $1}') +# check for error -if [ "$osp" = "Debian" ]; then - echo "Debian" +if [ $? -ne 0 ]; then + cat installed_packages | awk '{print $1}' | while read -r package; do + apt install -q -s -y $package +done fi -if [ "$osp" = "Arch" ]; then - echo "Arch" -fi +#cat installed_packages | awk '{print $1}' | while read -r package; do +# apt install -q -s -y $package +#done +