reuse standard temporary file name

This commit is contained in:
Daniel Micay 2025-08-01 21:25:30 -04:00
parent 04100dca2c
commit 4599ed0b06
2 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View file

@ -11,7 +11,6 @@
/tmp /tmp
/units/ /units/
/logs/ /logs/
*.tmp
/ovh-mitigation.json /ovh-mitigation.json
/ovh-mitigation.txt /ovh-mitigation.txt
/venv/ /venv/

View file

@ -43,10 +43,10 @@ rsync etc/{crypttab,locale.conf,mkinitcpio.conf,pacman.conf,pacreport.conf,resol
rsync etc/unbound/unbound.conf $remote:/mnt/etc/unbound/unbound.conf rsync etc/unbound/unbound.conf $remote:/mnt/etc/unbound/unbound.conf
if [[ $host = @(0.grapheneos.network|1.grapheneos.network|2.grapheneos.network|3.grapheneos.network) ]]; then if [[ $host = @(0.grapheneos.network|1.grapheneos.network|2.grapheneos.network|3.grapheneos.network) ]]; then
cp etc/chrony.conf etc/chrony.conf.tmp cp etc/chrony.conf tmp
echo -e '\nallow' >> etc/chrony.conf.tmp echo -e '\nallow' >> tmp
rsync etc/chrony.conf.tmp $remote:/mnt/etc/chrony.conf rsync tmp $remote:/mnt/etc/chrony.conf
rm etc/chrony.conf.tmp rm tmp
else else
rsync etc/chrony.conf $remote:/mnt/etc/chrony.conf rsync etc/chrony.conf $remote:/mnt/etc/chrony.conf
fi fi
@ -54,10 +54,10 @@ ssh $remote mkdir -vp /mnt/etc/sysconfig
rsync etc/sysconfig/chronyd $remote:/mnt/etc/sysconfig/chronyd rsync etc/sysconfig/chronyd $remote:/mnt/etc/sysconfig/chronyd
rsync ${hosts_authorized_keys[$host]:-authorized_keys} $remote:/mnt/root/.ssh/authorized_keys rsync ${hosts_authorized_keys[$host]:-authorized_keys} $remote:/mnt/root/.ssh/authorized_keys
cp etc/ssh/sshd_config etc/ssh/sshd_config.tmp cp etc/ssh/sshd_config tmp
sed -i "s/{{ssh_users}}/${hosts_ssh_users[$host]:-root}/g" etc/ssh/sshd_config.tmp sed -i "s/{{ssh_users}}/${hosts_ssh_users[$host]:-root}/g" tmp
rsync etc/ssh/sshd_config.tmp $remote:/mnt/etc/ssh/sshd_config rsync tmp $remote:/mnt/etc/ssh/sshd_config
rm etc/ssh/sshd_config.tmp rm tmp
synproxy_threshold=$(( ${hosts_conntrack_size[$host]} / 64 )) synproxy_threshold=$(( ${hosts_conntrack_size[$host]} / 64 ))
sed "s/{{synproxy_threshold}}/$synproxy_threshold/g" etc/nftables/nftables-${hosts_firewall[$host]:-web}.conf >tmp sed "s/{{synproxy_threshold}}/$synproxy_threshold/g" etc/nftables/nftables-${hosts_firewall[$host]:-web}.conf >tmp