Use $target/etc/resolvconf/run/resolv.conf
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 96-apt-listbugs
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/96-apt-listbugs
3 # Purpose:       retreive list of bugreports of installed packages inside chroot
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 # Latest change: Sun Nov 04 11:08:40 CET 2007 [mika]
8 ################################################################################
9
10 set -e
11
12 if ifclass RELEASE ; then
13
14   HOSTNAME=''
15   [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
16   [ -n "$HOSTNAME" ] || HOSTNAME=grml
17
18   if [ -r /etc/resolv.conf ] ; then
19      if [ -r $target/etc/resolvconf/run/resolv.conf ] ; then
20         cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
21      else
22         cat /etc/resolv.conf >> $target/etc/resolv.conf
23      fi
24   fi
25
26   if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
27      [ -x $target/etc/apt/grml/listbugs ] ; then
28      for severity in critical grave serious ; do
29          SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
30          /var/log/fai/dirinstall/$HOSTNAME/bugs.${severity} || true # make sure it does not fail
31      done
32   fi
33
34 fi
35
36 ## END OF FILE #################################################################