mirror of https://github.com/docker/docs.git
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
|
@ -5,10 +5,15 @@ set -e
|
||||||
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
|
||||||
|
|
||||||
: ${CONFIG:=/proc/config.gz}
|
: ${CONFIG:=/proc/config.gz}
|
||||||
: ${GREP:=zgrep}
|
|
||||||
|
if ! command -v zgrep &> /dev/null; then
|
||||||
|
zgrep() {
|
||||||
|
zcat "$2" | grep "$1"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
is_set() {
|
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
|
# see http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||||
|
|
Loading…
Reference in New Issue