mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update contrib/check-config.sh to use zcat and grep if zgrep isn't available
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
This commit is contained in:
parent
aec989bd08
commit
9712f8127a
1 changed files with 7 additions and 2 deletions
|
@ -5,10 +5,15 @@ set -e
|
|||
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
||||
|
||||
: ${CONFIG:=/proc/config.gz}
|
||||
: ${GREP:=zgrep}
|
||||
|
||||
if ! command -v zgrep &> /dev/null; then
|
||||
zgrep() {
|
||||
zcat "$2" | grep "$1"
|
||||
}
|
||||
fi
|
||||
|
||||
is_set() {
|
||||
$GREP "CONFIG_$1=[y|m]" $CONFIG > /dev/null
|
||||
zgrep "CONFIG_$1=[y|m]" "$CONFIG" > /dev/null
|
||||
}
|
||||
|
||||
# see http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||
|
|
Loading…
Reference in a new issue