Consolidate grep text searching predicates to use "grep -qs"
If this is deemed not portable enough in the future, it should be easy enough to find/replace. Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
30bafdae57
commit
daec955a09
|
@ -42,7 +42,7 @@ Check_lockfile .lock
|
|||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
|
||||
if ls -A config/binary_local-includes/ | grep . > /dev/null 2>&1
|
||||
if ls -A config/binary_local-includes/ | grep -qs .
|
||||
then
|
||||
# Copying includes
|
||||
cd config/binary_local-includes
|
||||
|
|
|
@ -78,7 +78,7 @@ case "${LH_NET_TARBALL}" in
|
|||
;;
|
||||
|
||||
gzip)
|
||||
if gzip --help | grep -q "\-\-rsyncable"
|
||||
if gzip --help | grep -qs "\-\-rsyncable"
|
||||
then
|
||||
tar cf binary-net.tar "$(basename ${OLDPWD})/${ROOT_DIR}" "$(basename ${OLDPWD})/tftpboot"
|
||||
gzip --rsyncable --best binary-net.tar
|
||||
|
|
|
@ -280,7 +280,7 @@ Configure_syslinux_templates ()
|
|||
# Syslinux v3.31 in etch does not support include statements
|
||||
if [ "${LH_DISTRIBUTION}" = "etch" ]
|
||||
then
|
||||
while grep -q ^include ${SCREEN_PATH}/syslinux.cfg
|
||||
while grep -qs ^include ${SCREEN_PATH}/syslinux.cfg
|
||||
do
|
||||
INCLUDES=$(grep ^include ${SCREEN_PATH}/syslinux.cfg |awk '{print $2}')
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ Create_lockfile .lock
|
|||
# Remove old binary
|
||||
rm -f binary.tar.gz
|
||||
|
||||
if gzip --help | grep -q '\-\-rsyncable'
|
||||
if gzip --help | grep -qs '\-\-rsyncable'
|
||||
then
|
||||
tar cf binary-tar.tar binary
|
||||
gzip --rsyncable --best binary-tar.tar
|
||||
|
|
|
@ -42,7 +42,7 @@ Check_lockfile .lock
|
|||
# Creating lock file
|
||||
Create_lockfile .lock
|
||||
|
||||
if ls -A config/chroot_local-includes/ | grep . > /dev/null 2>&1
|
||||
if ls -A config/chroot_local-includes/ | grep -qs .
|
||||
then
|
||||
# Copying includes
|
||||
cd config/chroot_local-includes
|
||||
|
|
|
@ -60,7 +60,7 @@ cp -a config source/debian-live
|
|||
# Create tarball
|
||||
cd source
|
||||
|
||||
if gzip --help | grep -q '\-\-rsyncable'
|
||||
if gzip --help | grep -qs '\-\-rsyncable'
|
||||
then
|
||||
tar cf debian-live-config_$(date +%Y%m%d.%s).tar debian-live
|
||||
gzip --rsyncable --best debian-live-config_$(date +%Y%m%d.%s).tar
|
||||
|
|
|
@ -59,7 +59,7 @@ then
|
|||
fi
|
||||
|
||||
# Create tarball
|
||||
if gzip --help | grep -q '\-\-rsyncable'
|
||||
if gzip --help | grep -qs '\-\-rsyncable'
|
||||
then
|
||||
tar cf source-net.tar source
|
||||
gzip --rsyncable --best source-net.tar
|
||||
|
|
|
@ -60,7 +60,7 @@ then
|
|||
fi
|
||||
|
||||
# Create tarball
|
||||
if gzip --help | grep -q '\-\-rsyncable'
|
||||
if gzip --help | grep -qs '\-\-rsyncable'
|
||||
then
|
||||
tar cf source.tar source
|
||||
gzip --rsyncable --best source.tar
|
||||
|
|
Loading…
Reference in New Issue