/[resolvconf]/resolvconf/trunk/debian/postinst
ViewVC logotype

Diff of /resolvconf/trunk/debian/postinst

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 52 by jdthood-guest, Tue May 15 08:55:01 2007 UTC revision 58 by rekt-guest, Mon Dec 31 20:04:43 2007 UTC
# Line 8  set -e Line 8  set -e
8  MYNAME=resolvconf.postinst  MYNAME=resolvconf.postinst
9  report() { echo "${MYNAME}: $*" ; }  report() { echo "${MYNAME}: $*" ; }
10  report_err() { report "Error: $*" >&2 ; }  report_err() { report "Error: $*" >&2 ; }
11    report_info() { report "Info: $*" >&2 ; }
12    
13  ### Create /etc/resolvconf/run ###  ### Create /etc/resolvconf/run ###
14  case "$1" in  case "$1" in
# Line 22  configure|reconfigure) Line 23  configure|reconfigure)
23                  if [ -z "$RUN_CANONICALPATH" ] ; then                  if [ -z "$RUN_CANONICALPATH" ] ; then
24                          report_err "Deleting /etc/resolvconf/run symlink whose canonical path could not be determined"                          report_err "Deleting /etc/resolvconf/run symlink whose canonical path could not be determined"
25                          rm -f /etc/resolvconf/run                          rm -f /etc/resolvconf/run
26                    elif [ "$RUN_CANONICALPATH" = "/dev/shm/resolvconf" ] && \
27                            [ -d /lib/init/rw ] \
28                            && [ -w /lib/init/rw ] \
29                            && [ -r /proc/mounts ] \
30                            && grep -qs "^tmpfs[[:space:]]\+/lib/init/rw[[:space:]]\+tmpfs[[:space:]]\+\([^[:space:]]\+,\)\?rw" /proc/mounts \
31                            && { [ -d /lib/init/rw/resolvconf ] || mkdir -v /lib/init/rw/resolvconf ; } \
32                            && { [ -d /lib/init/rw/resolvconf/interface ] || mkdir -v /lib/init/rw/resolvconf/interface ; }
33                            then
34                            report_info "Migrating /dev/shm/resolvconf to /lib/init/rw/resolvconf"
35                            cp -a /dev/shm/resolvconf/* /lib/init/rw/resolvconf
36                            rm -f /etc/resolvconf/run
37                            ln -s /lib/init/rw/resolvconf /etc/resolvconf/run
38                  fi                  fi
39          fi          fi
40          # Delete it if it isn't a directory or a link to one          # Delete it if it isn't a directory or a link to one
# Line 43  configure|reconfigure) Line 56  configure|reconfigure)
56                  mkdir -v "${RUN_CANONICALPATH}/interface"                  mkdir -v "${RUN_CANONICALPATH}/interface"
57          else          else
58                  # It's a nonexistent                  # It's a nonexistent
59                  # Use /dev/shm if possible                  # Use /lib/init/rw if possible
60                  if \                  if \
61                          [ -d /dev/shm ] \                          [ -d /lib/init/rw ] \
62                          && [ -w /dev/shm ] \                          && [ -w /lib/init/rw ] \
63                          && [ -r /proc/mounts ] \                          && [ -r /proc/mounts ] \
64                          && grep -qs "^tmpfs[[:space:]]\+/dev/shm[[:space:]]\+tmpfs[[:space:]]\+\([^[:space:]]\+,\)\?rw" /proc/mounts \                          && grep -qs "^tmpfs[[:space:]]\+/lib/init/rw[[:space:]]\+tmpfs[[:space:]]\+\([^[:space:]]\+,\)\?rw" /proc/mounts \
65                          && ! grep -qs '[[:space:]]/dev[[:space:]]devfs[[:space:]]' /proc/mounts \                          && { [ -d /lib/init/rw/resolvconf ] || mkdir -v /lib/init/rw/resolvconf ; } \
66                          && { [ -d /dev/shm/resolvconf ] || mkdir -v /dev/shm/resolvconf ; } \                          && { [ -d /lib/init/rw/resolvconf/interface ] || mkdir -v /lib/init/rw/resolvconf/interface ; }
                         && { [ -d /dev/shm/resolvconf/interface ] || mkdir -v /dev/shm/resolvconf/interface ; }  
67                  then                  then
68                          ln -s /dev/shm/resolvconf /etc/resolvconf/run                          ln -s /lib/init/rw/resolvconf /etc/resolvconf/run
69                  else                  else
70                          mkdir -v /etc/resolvconf/run                          mkdir -v /etc/resolvconf/run
71                          mkdir -v /etc/resolvconf/run/interface                          mkdir -v /etc/resolvconf/run/interface

Legend:
Removed from v.52  
changed lines
  Added in v.58

  ViewVC Help
Powered by ViewVC 1.1.5