需求
希望写一个脚本用来管理多个ssh ip
功能 xx.sh 1
ssh ip1
xx.sh 2
ssh ip2
实现
#!/bin/bash
echo "conneted"
echo $1
if [ 1 == "$1" ];then
echo "connect product"
ssh xxx
elif [ 2 == "$1" ];then
echo "connect test"
ssh xxxx
fi
希望写一个脚本用来管理多个ssh ip
功能 xx.sh 1
ssh ip1
xx.sh 2
ssh ip2
实现
#!/bin/bash
echo "conneted"
echo $1
if [ 1 == "$1" ];then
echo "connect product"
ssh xxx
elif [ 2 == "$1" ];then
echo "connect test"
ssh xxxx
fi