diff options
| author | Super User <root@p.noml.ch> | 2026-03-23 19:18:34 +0800 |
|---|---|---|
| committer | Super User <root@p.noml.ch> | 2026-03-23 19:18:34 +0800 |
| commit | 6086e908152e97011681e6d91cd7fe627c5cf02f (patch) | |
| tree | c0a4b86266dda798f02ab3b04cffd52e7b7da9dc /core | |
| parent | 1dab0d9e770466c64b6a822d30307848b710c40c (diff) | |
fix ssh sed-replace, remove set paste, add claude idempotency guard
Diffstat (limited to 'core')
| -rwxr-xr-x | core/packages/install_claude.sh | 3 | ||||
| -rwxr-xr-x | core/ssh.sh | 14 | ||||
| -rwxr-xr-x | core/vim.sh | 1 |
3 files changed, 12 insertions, 6 deletions
diff --git a/core/packages/install_claude.sh b/core/packages/install_claude.sh index 99a881d..6a730d6 100755 --- a/core/packages/install_claude.sh +++ b/core/packages/install_claude.sh | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | |||
| 3 | command -v claude &>/dev/null && exit 0 | ||
| 4 | |||
| 2 | sudo dnf install -y tar | 5 | sudo dnf install -y tar |
| 3 | # Install Node.js via nvm and Claude Code | 6 | # Install Node.js via nvm and Claude Code |
| 4 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash | 7 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash |
diff --git a/core/ssh.sh b/core/ssh.sh index f23d571..63d5ea9 100755 --- a/core/ssh.sh +++ b/core/ssh.sh | |||
| @@ -1,11 +1,15 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | dnf install -y git | 3 | sudo dnf install -y git |
| 4 | 4 | ||
| 5 | grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config | 5 | sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config |
| 6 | grep -q 'AllowTcpForwarding yes' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config | 6 | grep -q '^PasswordAuthentication' /etc/ssh/sshd_config || echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config |
| 7 | grep -q 'GatewayPorts yes' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | 7 | sudo sed -i 's/^#\?AllowTcpForwarding.*/AllowTcpForwarding yes/' /etc/ssh/sshd_config |
| 8 | grep -q 'AllowAgentForwarding yes' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config | 8 | grep -q '^AllowTcpForwarding' /etc/ssh/sshd_config || echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config |
| 9 | sudo sed -i 's/^#\?GatewayPorts.*/GatewayPorts yes/' /etc/ssh/sshd_config | ||
| 10 | grep -q '^GatewayPorts' /etc/ssh/sshd_config || echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 11 | sudo sed -i 's/^#\?AllowAgentForwarding.*/AllowAgentForwarding yes/' /etc/ssh/sshd_config | ||
| 12 | grep -q '^AllowAgentForwarding' /etc/ssh/sshd_config || echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 9 | 13 | ||
| 10 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | 14 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 11 | "$SCRIPT_DIR/../keys/add-ssh-keys.sh" | 15 | "$SCRIPT_DIR/../keys/add-ssh-keys.sh" |
diff --git a/core/vim.sh b/core/vim.sh index bd99a13..2b2854e 100755 --- a/core/vim.sh +++ b/core/vim.sh | |||
| @@ -57,7 +57,6 @@ nnoremap <C-e> $ | |||
| 57 | 57 | ||
| 58 | set number | 58 | set number |
| 59 | setlocal regexpengine=2 | 59 | setlocal regexpengine=2 |
| 60 | set paste | ||
| 61 | set foldcolumn=12 | 60 | set foldcolumn=12 |
| 62 | 61 | ||
| 63 | set noswapfile | 62 | set noswapfile |
