init-functions now checks for read access before attempting to read environ

This commit is contained in:
2017-12-10 11:47:48 -06:00
parent 8d4cb9e335
commit 97906ebe04
2 changed files with 5 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ DESC = This package supplies the core required init scripts for startup
ARCHIVE := '' ARCHIVE := ''
SRCDIR := $(PWD)/SRC/initscripts SRCDIR := $(PWD)/SRC/initscripts
PATCHDIR := $(PWD)/SRC/patches PATCHDIR := $(PWD)/SRC/patches
VERSION := 1.5-0 VERSION := 1.6-0
include /usr/share/snap/Makefile.snaplinux include /usr/share/snap/Makefile.snaplinux

View File

@@ -8,7 +8,10 @@
# be enough # be enough
# #
chkcontainer=$(sed 's/\x0/\n/g' < /proc/1/environ|grep -ia '^container\|^LXC') if [ -r /proc/1/environ ]; then
chkcontainer=$(sed 's/\x0/\n/g' < /proc/1/environ|grep -ia '^container\|^LXC')
fi
[ -n "$chkcontainer" ] && export $chkcontainer [ -n "$chkcontainer" ] && export $chkcontainer
COL52="\\033[52G" COL52="\\033[52G"