Changeset 5916995 for debian/config


Ignore:
Timestamp:
2009-06-07T19:40:45Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
25dfb16
Parents:
b6dd429
Message:

Fixed free port detection code in debian/config which was a bit limited
and also buggy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debian/config

    rb6dd429 r5916995  
    77db_get bitlbee/serveport
    88if [ "$RET" = "stillhavetoask" ]; then
    9         if netstat -ltn | grep ':6667' 2> /dev/null > /dev/null; then
    10                 port=6668;
    11         else
    12                 port=6667;
    13         fi
     9        listens=$(netstat -ltn | awk '{print $4}')
     10        for port in 6667 6666 6668 6669; do
     11                if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then
     12                        break
     13                fi
     14        done
    1415        db_set bitlbee/serveport $port;
    1516fi
Note: See TracChangeset for help on using the changeset viewer.