source: debian/config @ 5916995

Last change on this file since 5916995 was 5916995, checked in by Wilmer van der Gaast <wilmer@…>, at 2009-06-07T19:40:45Z

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

  • Property mode set to 100755
File size: 377 bytes
Line 
1#!/bin/sh -e
2
3. /usr/share/debconf/confmodule
4
5db_title BitlBee
6
7db_get bitlbee/serveport
8if [ "$RET" = "stillhavetoask" ]; then
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
15        db_set bitlbee/serveport $port;
16fi
17
18if db_input medium bitlbee/serveport; then
19        db_go;
20fi
Note: See TracBrowser for help on using the repository browser.