From 2e92c12b2b82f8686d409c32341d1dd8ef8a5765 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Mon, 24 Sep 2012 13:36:43 +0200 Subject: [PATCH] Avoid using carnet-tools-cn in debian/config (RT#90912). --- debian/config | 15 +++++++++++---- debian/control | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/config b/debian/config index 1fe6e1f..73c4f4c 100644 --- a/debian/config +++ b/debian/config @@ -11,12 +11,19 @@ if [ -z "$RET" ]; then fi # Guess default ip -. /usr/share/carnet-tools/functions.sh -cp_get_ifaddr -IP=$RET db_get bacula-cn/ip || true if [ -z "$RET" ]; then - db_set bacula-cn/ip "$IP" + # default via 161.53.55.1 dev eth0 + DEV=$( ip route show to exact 0/0 \ + | awk '$1 == "default" && $4 == "dev" { print $5; nextfile }' ) + if [ "$DEV" ]; then + # inet 161.53.55.202/24 brd 161.53.55.255 scope global eth0 + IP=$( ip address show dev $DEV scope global \ + | awk '$1 == "inet" { sub("/[^ ]+", ""); print $2; nextfile }' ) + if [ "$IP" ]; then + db_set bacula-cn/ip "$IP" + fi + fi fi # Sample contact diff --git a/debian/control b/debian/control index bba884a..1c070d9 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Vcs-Browser: http://ftp.carnet.hr/carnet-debian/scm/?p=bacula-cn.git;a=summary Package: bacula-cn Architecture: all Depends: bacula-fd (>= 5), bacula-console (>= 5), openssl, gnupg, - debconf (>= 0.5) | debconf-2.0, carnet-tools-cn, ${misc:Depends} + debconf (>= 0.5) | debconf-2.0, ${misc:Depends} Suggests: mysql-client, postgresql-client-common, mail-transport-agent Description: Network backup configuration for CARNet members This package install Bacula client daemon and configures it for use -- 1.7.10.4