bunch of minor updates
[automated-distro-installer] / fai-redep
index c90aea8b8bde2398222bdafa3b4923039deff7c6..05414973ff69f9607fb7fec8f75897540cc5c2e4 100755 (executable)
--- a/fai-redep
+++ b/fai-redep
@@ -59,10 +59,13 @@ sudo rsync -a /root/.ssh/home.pub \
 # these files are not available.
 
 if [[ $target ]]; then
+  if sudo test -e /q/root/shadow/$target; then
+    shadowfile=shadow/$target # empty otherwise
+  fi
   sudo rsync -lpt --files-from=- /q/root root@$faiserver_host:/srv/fai/config/distro-install-common <<EOF
 luks/$target
 luks/host-$target
-shadow/$target
+$shadowfile
 EOF
 else
   sudo rsync -rlpt /q/root/shadow /q/root/luks root@$faiserver_host:/srv/fai/config/distro-install-common
@@ -80,7 +83,7 @@ printf "%s\n%s\n" "PACKAGES install" ${pall[*]} | \
   ssh root@$faiserver_host dd of=/srv/fai/config/package_config/DESKTOP 2>/dev/null ||: # broken pipe
 
 
-rsync -rplt --delete $BASEFILE_DIR/*.gz root@$faiserver_host:/srv/fai/config/basefiles/
+rsync -rplt --include '/*.gz' --exclude '/**' --delete-excluded $BASEFILE_DIR/ root@$faiserver_host:/srv/fai/config/basefiles/
 ssh root@$faiserver_host bash <<'EOF'
 set -eE -o pipefail
 # make it the root because pxe-kexec only looks there.