diff --git a/tab-sorcery.sh b/tab-sorcery.sh index 9e244b8..b91ac4a 100644 --- a/tab-sorcery.sh +++ b/tab-sorcery.sh @@ -45,8 +45,8 @@ while read host <&3; do connect_cmd="ssh -t" host_short=`echo ${host} | awk -F. '{print $1}'` if echo $zone_xfer | grep $host | grep TXT; then - if [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"logroot"' ]; then - user_name="root" + if [ "`echo $zone_xfer | grep $host | grep TXT | awk '$3 ~ /^"log/ {print $3}'`" ]; then + user_name=$(echo $zone_xfer | grep $host | grep TXT | awk '$3 ~ /^"log/ {print $3}' | sed 's/^"log//' | tr -d '"') get_hostip ${host} alias ${host_short}="${connect_cmd} ${user_name}@${host_ip}" elif [ "`echo $zone_xfer | grep $host | grep TXT | awk '{print $3}'`" = '"windows"' ]; then