I'm new on bash. I want to write a script which will run iwconfig
command the output should show me my wlan* mode is Managed or Monitor?
I had tried this like following but it is not working and runs the command output. I just need to echo
which mode is it.
IWCONFIG_LOG="$(iwconfig)"
if [[ "$IWCONFIG_LOG" == *Mode:Managed* ]]; then
echo "Managed"
elif [[ "$IWCONFIG_LOG" == *Mode:Monitor* ]]; then
echo "Monitor Mode"
fi