aboutsummaryrefslogtreecommitdiffstats
path: root/debian/config
diff options
context:
space:
mode:
Diffstat (limited to 'debian/config')
-rwxr-xr-xdebian/config11
1 files changed, 6 insertions, 5 deletions
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