Executing script after wifi is on
I want to run a script after I connect to a specific wifi network. First, I've tried to run it after the wifi turns on (without selecting a specific network), but I did not succeed. The script I have tried running is:
#!/bin/sh
echo "I am in ifup-local"
if[[ "$1" == "wlp3s0" ]]
then
echo "wlp3s0 is active"
fi
I've named it ifup-local or ifup-pre-local and given it permissions with chmod +x. I have placed it on sbin, etc/NetworkManager/dispatcher.d and etc/network-scripts (one at a time only), but it has not worked. When I do sudo ifup wlp3s0
on the terminal to turn on wifi I expect to see the first echo but not even that happens.
I've followed these instructions: http://xmodulo.com/how-to-run-startup... , and googled many answers on stack exchange and similar sites (didn't find anything related here). All those answers say the problem is easy, but none of them has worked for me. This makes me think the solution must be fedora specific.
Any help is much appreciated, even if it's something simple as placing it s/w else or renaming it.