Skip to content

Instantly share code, notes, and snippets.

@daleysoftware
Created January 14, 2015 00:50
Show Gist options
  • Save daleysoftware/cd02a476c9a0a53245e7 to your computer and use it in GitHub Desktop.
Save daleysoftware/cd02a476c9a0a53245e7 to your computer and use it in GitHub Desktop.
Check AeroFS Appliance ports.
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage: $0 <appliance_host>"
exit 1
fi
appliance_host=$1
# TCP
for port in 80 443 4433 8084 8484 8888 29438
do
nc -w 2 -z $appliance_host $port
if [ $? -ne 0 ]
then
echo "$port: tcp not listening"
else
echo "$port: okay"
fi
done
# UDP
for port in 5522
do
nc -u -w 2 -z $appliance_host $port
if [ $? -ne 0 ]
then
echo "$port: udp not listening"
else
echo "$port: okay"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment