bash syntax for if [[ ]]

This commit is contained in:
Sandino Araico Sanchez 2016-12-22 23:27:05 -06:00
parent dfd13dca60
commit 84f7d4dc0c
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ export OUTPUT_DIR
export SNAPSHOT_D
mkdir -p $OUTPUT_DIR
if [ ! -f $OUTPUT_DIR/dmidecode ] ; then
if [[ ! -f $OUTPUT_DIR/dmidecode ]] ; then
dmidecode > $OUTPUT_DIR/dmidecode
fi

View file

@ -1,6 +1,6 @@
#!/bin/bash
if [ -z $OUTPUT_DIR ] ; then
if [[ -z $OUTPUT_DIR ]] ; then
source scan-dmidecode
fi
@ -9,7 +9,7 @@ for DEV in \
`cat /proc/net/dev | grep ':' | cut -d ':' -f 1`
do
MAC=`ethtool -P $DEV | cut -d ':' -f 2-9 | sed 's/\s\+//g'`
if [ "$MAC" != "00:00:00:00:00:00" ] ; then
if [[ "$MAC" != "00:00:00:00:00:00" ]] ; then
#echo "$DEV $MAC"
echo "$DEV $MAC" >> $OUTPUT_DIR/netdev.lst
mkdir -p $OUTPUT_DIR/netdev