#!/bin/bash
#
host=192.168.19.3
port=22
ping -c 1 -W 2000 192.168.2.2
if [ $? != 0 ];then
echo "本电脑没有网络,请检查"
(/usr/bin/osascript -e 'display dialog "没有网络,请检查" buttons {"OK"} default button "OK" ')
exit 0
fi
local_ip=`ifconfig | grep -F 10. | cut -f2 -d' '`
local_ip="本机ip ${local_ip}"
echo $local_ip
nc -zvv $host $port
if [ $? != 0 ];then
(/usr/bin/osascript -e
"set local_ip to \"$local_ip\" " -e
'display dialog local_ip & "\nFTP服务器网络不通,请联系 JS-ES.Security@bbbb-admin.com" buttons {"OK"} default button "OK" ')
exit 0
else
echo "到FTP服务器是通的"
(/usr/bin/osascript -e "set local_ip to \"$local_ip\" " -e 'display dialog local_ip & "到FTP服务器是通的" buttons {"OK"} default button "OK" ')
exit 0
fi