1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

clarif: "if <command>; then" works with "grep -q" etc

This commit is contained in:
A Holt 2017-12-12 09:40:25 -05:00 committed by GitHub
parent ea2c395fc9
commit f9593392e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,9 @@ if [ "OS" == "centos" ] || [ "OS" == "fedora" ]; then
ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log
fi
# Ubuntu desktop might be using NM - split out.
# if [ $(which nmcli) ]; then
# if [[ `which nmcli` ]]; then
if which nmcli; then
# if [ $(which nmcli) ]; then # syntax fails when multiple lines returned
# if [[ `which nmcli` ]]; then # syntax also works
if which nmcli; then # syntax works great, with "grep -q" too!
nmcli d >> iiab-network.log
nmcli c >> iiab-network.log
fi