From 1dab0d9e770466c64b6a822d30307848b710c40c Mon Sep 17 00:00:00 2001 From: Super User Date: Mon, 23 Mar 2026 19:16:09 +0800 Subject: embed keys, make scripts idempotent --- core/packages/install_rust.sh | 2 +- core/ssh.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/packages/install_rust.sh b/core/packages/install_rust.sh index 921a533..a0b0728 100755 --- a/core/packages/install_rust.sh +++ b/core/packages/install_rust.sh @@ -2,6 +2,6 @@ # Install Rust and Cargo tools curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc +grep -q 'cargo/env' ~/.bashrc || echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc source "$HOME/.cargo/env" cargo install cargo-clone-crate cargo-edit cargo-info evcxr_jupyter bacon du-dust ripgrep bandwhich diff --git a/core/ssh.sh b/core/ssh.sh index c4454ae..f23d571 100755 --- a/core/ssh.sh +++ b/core/ssh.sh @@ -2,11 +2,11 @@ dnf install -y git -echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config -echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config -echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config -echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config +grep -q 'AllowTcpForwarding yes' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'GatewayPorts yes' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config +grep -q 'AllowAgentForwarding yes' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config -git clone https://git.noml.ch/keys/ ~/keys -~/keys/add-ssh-keys.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +"$SCRIPT_DIR/../keys/add-ssh-keys.sh" sudo systemctl restart sshd -- cgit