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
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