Merge pull request #545 from amishxda/master

add noportcheck to not to check if port is in use
This commit is contained in:
Jamie Cameron
2017-05-03 19:03:32 -07:00
committed by GitHub

View File

@@ -363,11 +363,13 @@ else
echo ""
exit 12
fi
$perl -e 'use Socket; socket(FOO, PF_INET, SOCK_STREAM, getprotobyname("tcp")); setsockopt(FOO, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); bind(FOO, pack_sockaddr_in($ARGV[0], INADDR_ANY)) || exit(1); exit(0);' $port
if [ $? != "0" ]; then
echo "ERROR: TCP port $port is already in use by another program"
echo ""
exit 13
if [ "$noportcheck" = "" ]; then
$perl -e 'use Socket; socket(FOO, PF_INET, SOCK_STREAM, getprotobyname("tcp")); setsockopt(FOO, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); bind(FOO, pack_sockaddr_in($ARGV[0], INADDR_ANY)) || exit(1); exit(0);' $port
if [ $? != "0" ]; then
echo "ERROR: TCP port $port is already in use by another program"
echo ""
exit 13
fi
fi
printf "Login name (default admin): "
if [ "$login" = "" ]; then