use checksum-based rsync

This commit is contained in:
Daniel Micay 2024-03-03 09:53:39 -05:00
parent d8b70fce4f
commit fb8775bb85
1 changed files with 11 additions and 11 deletions

View File

@ -13,38 +13,38 @@ ssh $remote '[[ $(grep IMAGE_VERSION /etc/os-release) = "IMAGE_VERSION=2024.02.0
ssh $remote "sfdisk /dev/$drive -w always <<< ';'"
ssh $remote "mkfs.xfs -d agcount=$agcount -f /dev/${drive}1"
rsync -tv pacman.d/mirrorlist $remote:/etc/pacman.d/mirrorlist
rsync -cv pacman.d/mirrorlist $remote:/etc/pacman.d/mirrorlist
ssh $remote "mount /dev/${drive}1 /mnt"
ssh $remote "pacstrap -K /mnt base bash-completion chrony cloud-guest-utils conntrack-tools grub htop ioping linux-lts logrotate lsof man-db moreutils mtr nftables nginx openssh pacman-contrib pacutils plocate pv rsync strace sysstat tree unbound vim xfsprogs"
ssh $remote "echo $hostname >/mnt/etc/hostname"
rsync -ptv --chmod=644 systemd/network/$host.link $remote:/mnt/etc/systemd/network/10-public.link
rsync -ptv --chmod=644 systemd/network/$host.network $remote:/mnt/etc/systemd/network/10-public.network
rsync -cpv --chmod=644 systemd/network/$host.link $remote:/mnt/etc/systemd/network/10-public.link
rsync -cpv --chmod=644 systemd/network/$host.network $remote:/mnt/etc/systemd/network/10-public.network
rsync -ptv --chmod=644 crypttab environment fstab hosts locale.conf pacman.conf pacreport.conf resolv.conf $remote:/mnt/etc/
rsync -cpv --chmod=644 crypttab environment fstab hosts locale.conf pacman.conf pacreport.conf resolv.conf $remote:/mnt/etc/
rsync -tv grub $remote:/mnt/etc/default/grub
rsync -cv grub $remote:/mnt/etc/default/grub
ssh $remote "arch-chroot /mnt grub-install /dev/$drive"
ssh $remote "arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg"
rsync -tv unbound.conf $remote:/mnt/etc/unbound/unbound.conf
rsync -cv unbound.conf $remote:/mnt/etc/unbound/unbound.conf
if [[ $host = @(0.grapheneos.network|1.grapheneos.network|2.grapheneos.network|3.grapheneos.network) ]]; then
cp chrony.conf chrony.conf.tmp
echo -e '\nallow' >> chrony.conf.tmp
rsync -tv chrony.conf.tmp $remote:/mnt/etc/chrony.conf
rsync -cv chrony.conf.tmp $remote:/mnt/etc/chrony.conf
rm chrony.conf.tmp
else
rsync -tv chrony.conf $remote:/mnt/etc/chrony.conf
rsync -cv chrony.conf $remote:/mnt/etc/chrony.conf
fi
ssh $remote mkdir -vp /mnt/etc/sysconfig
rsync -ptv --chmod 644 sysconfig/chronyd $remote:/mnt/etc/sysconfig/chronyd
rsync -cpv --chmod 644 sysconfig/chronyd $remote:/mnt/etc/sysconfig/chronyd
rsync -tv authorized_keys $remote:/mnt/root/.ssh/authorized_keys
rsync -cv authorized_keys $remote:/mnt/root/.ssh/authorized_keys
cp ssh/sshd_config ssh/sshd_config.tmp
sed -i "s/{{ssh_users}}/${hosts_ssh_users[$host]:-root}/g" ssh/sshd_config.tmp
rsync -tv ssh/sshd_config.tmp $remote:/mnt/etc/ssh/sshd_config
rsync -cv ssh/sshd_config.tmp $remote:/mnt/etc/ssh/sshd_config
rm ssh/sshd_config.tmp
ssh $remote "arch-chroot /mnt systemctl enable chronyd.service fstrim.timer logrotate.timer plocate-updatedb.timer systemd-networkd.service sshd.service unbound.service"