Merge remote-tracking branch 'origin/github/pr/145'
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 37-portmap
1 #!/bin/bash
2 # Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/37-portmap
3 # Purpose:       configure portmap of live-system
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 ################################################################################
8
9 set -u
10 set -e
11
12 # Work around a bug in the portmap package, see
13 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=317358
14
15 CONFFILE="$target/etc/default/portmap"
16
17 # modify only if the file is present, nowadays we have rpcbind
18 if [ -r "$CONFFILE" ] ; then
19  # modify it iff we have portmap's default configuration
20  if grep -q '^OPTIONS="-i 127.0.0.1"' "$CONFFILE" ; then
21    # disable the "-i 127.0.0.1" configuration so it works e.g. with
22    # grml-terminalserver OOTB:
23    printf "Removing loopback-interface-only option (workaround #317358) in /etc/default/portmap: "
24    sed -i 's/^OPTIONS.*/# OPTIONS="-i 127.0.0.1"/' "$CONFFILE" && echo OK || echo ERROR
25  fi
26 fi
27
28 ## END OF FILE #################################################################
29 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2