0

As there is no rc.local file in Intel Edison, how do I run a command in a .sh file during startup? I'm running iwconfig wlan0 | grep -E -o ".{0,1}-.{0,6} |.{0,4}Mb/s.{0,3}|.{0,3}/70.{0,0}" and want it to execute during every startup and save it into a text file.

JACK
  • 17
  • 6
  • Use systemd. https://wiki.archlinux.org/index.php/Systemd_FAQ#How_can_I_make_a_script_start_during_the_boot_process.3F – tasasaki Apr 27 '16 at 09:21

1 Answers1

0

Intel Edison uses systemd for handling services. You can find these services in /lib/systemd/system , for e.g., create a copy of iotkit-agent.service, rename it to .service and modify accordingly.

Now all you have to do is

 systemctl daemon-reload
 systemctl start <yourscript>.service

To run this script on boot, you can enable it by running

systemctl enable <yourscript>.service 

Now reboot and see if it runs the script. You can also check the status by running the command

systemctl status <yourscript>.service
nraghuk
  • 156
  • 5