feat: Corrections shellcheck

This commit is contained in:
Xavier Logerais
2024-06-28 10:28:56 +00:00
parent 268ad94470
commit c2c0a11402
4 changed files with 16 additions and 18 deletions

View File

@@ -1,14 +1,12 @@
#!/bin/bash
function ssh_clean_known_hosts ()
{
if [ -z "$1" ]
then
function ssh_clean_known_hosts() {
if [ -z "$1" ]; then
echo "No arguments given. Cleaning ~/.ssh/known_hosts"
sed -i -e '/no hostip for proxy command/ d' ~/.ssh/known_hosts
else
hostname=$1
ip=$(ssh admin dig +short $1)
ip=$(ssh admin dig +short "$1")
echo "Removing host ${hostname} from ~/.ssh/known_hosts"
sed -i -e "/${hostname}/ d" ~/.ssh/known_hosts
echo "Removing ip ${ip} from ~/.ssh/known_hosts"