From f9d7ed94b13ea6a153a836a48a53510a3a638ba4 Mon Sep 17 00:00:00 2001 From: nyx Date: Thu, 31 Oct 2024 14:37:41 -0400 Subject: [PATCH] fix bug in ssh commands (#733) Co-authored-by: nyx --- core/tabs/utils/ssh.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/tabs/utils/ssh.sh b/core/tabs/utils/ssh.sh index 1e402546..e5a899ef 100644 --- a/core/tabs/utils/ssh.sh +++ b/core/tabs/utils/ssh.sh @@ -4,14 +4,15 @@ # Check if ~/.ssh/config exists, if not, create it if [ ! -f ~/.ssh/config ]; then - touch ~/.ssh/config - chmod 600 ~/.ssh/config + mkdir -p "$HOME/.ssh" + touch "$HOME/.ssh/config" + chmod 600 "$HOME/.ssh/config" fi # Function to show available hosts from ~/.ssh/config show_available_hosts() { printf "%b\n" "Available Systems:" - grep -E "^Host " ~/.ssh/config | awk '{print $2}' + grep -E "^Host " "$HOME/.ssh/config" | awk '{print $2}' printf "%b\n" "-------------------" }