I'm using Debian wheezy on an embedded platform (iMX.6 on Solidrun Hummingboard), and I have rfkill blocking my WiFi.
the command sudo rfkill unblock wifi works, so I've created a script called unblock_wifi.sh and put it in /etc/init.d:
#!/bin/bash
logFile=/var/log/unblock_wifi.log
timestamp=$(date +%Y%m%d_%H%M%S)
echo "unblock_wifi - Started at $timestamp" > $logFile
rfkill unblock wifi &>> $logFile
timestamp=$(date +%Y%m%d_%H%M%S)
echo "unblock_wifi - Done at $timestamp" >> $logFile
On boot, the script is called (the log appears on /var/log and the times are correct. There is nothing but the start and stop messages) but the wifi is still blocked. If I call the script myself after boot, the wifi is enabled.
My script is on /etc/rc2.d/S05unblock_wifi.sh, and it appears last on ls, I think it means that it runs last.
There's no script for rfkill though...
How does rfkill run without having a script in init.d? It probably runs after my script has ran. Where should I put my script in order for it to run after rfkill?
EDIT: I've searched all around for an answer, but everybody seems to recommend putting a script in /etc/init.d, which is what I tried