diff options
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | debian/config | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 46ae380b..6c7ea4f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ bitlbee (1.2.3-2) unstable; urgency=low (Closes: #531287) * Fixed bitlbee.deb dep in bitlbee-dev to deal with binary NMUs. (Closes: #531219) + * Fixed free port detection code in debian/config which was a bit limited + and also buggy. - -- Wilmer van der Gaast <wilmer@gaast.net> Sun, 07 Jun 2009 20:04:45 +0100 + -- Wilmer van der Gaast <wilmer@gaast.net> Sun, 07 Jun 2009 20:40:00 +0100 bitlbee (1.2.3-1) unstable; urgency=critical diff --git a/debian/config b/debian/config index 3a04813d..2bd9b879 100755 --- a/debian/config +++ b/debian/config @@ -6,11 +6,12 @@ db_title BitlBee db_get bitlbee/serveport if [ "$RET" = "stillhavetoask" ]; then - if netstat -ltn | grep ':6667' 2> /dev/null > /dev/null; then - port=6668; - else - port=6667; - fi + listens=$(netstat -ltn | awk '{print $4}') + for port in 6667 6666 6668 6669; do + if [ $(expr "$listens " : ".*:$port\s") = "0" ]; then + break + fi + done db_set bitlbee/serveport $port; fi |