Compare commits

...

2 Commits

Author SHA1 Message Date
nyx
5890bc8378
Merge 25ace4672d into e3688e9b3d 2024-10-25 16:05:30 +02:00
nyx
25ace4672d
fix bug in ssh commands 2024-10-02 08:33:47 -04:00

View File

@ -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" "-------------------"
}