[vpnc-scripts 3/3] vpnc-script: squelch EEXIST from grep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In a container, /etc/nsswitch.conf might not exist.
Silence the error grep: /etc/nsswitch.conf: No such file or directory

Signed-off-by: Robin H. Johnson <robbat2 at gentoo.org>
---
 vpnc-script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vpnc-script b/vpnc-script
index b185ad2..0ce5bd5 100755
--- a/vpnc-script
+++ b/vpnc-script
@@ -116,7 +116,7 @@ else
 	ifconfig_syntax_ptpv6=""
 fi
 
-grep ^hosts /etc/nsswitch.conf|grep resolve >/dev/null 2>&1
+grep ^hosts /etc/nsswitch.conf 2>/dev/null|grep resolve >/dev/null 2>&1
 if [ $? = 0 ];then
 	RESOLVEDENABLED=1
 else
-- 
2.14.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux