0

Situation: Whenever I boot up my Raspberry PI, I have to enter a few lines of commands to enable an interface. The commands:

sudo modprobe batman-adv
sudo batctl if add wlan0
sudo ifconfig wlan0 up
sudo ifconfig bat0 up

I would like to run a script that allows these commands to execute automatically when I boot up the Raspberry PI.

0

1 Answer 1

0

Add those commands to /etc/rc.local.

4
  • Do you mean /etc/init.d/rc.local? Mar 23, 2016 at 17:14
  • You can use both , but the purpose of /etc/rc.local is to provide a place to put shell commands to run at boot without having to deal with the stop|start service stuff, which is in /etc/init.d/rc.local.
    – storm
    Mar 23, 2016 at 17:19
  • Yes I want to create a shell which includes the above commands. Once that is done, do I need to put the script file in /etc/init.d/rc.local? Mar 23, 2016 at 17:23
  • You don't have to make a script , just add the commands in the end of the file before exit 0
    – storm
    Mar 23, 2016 at 17:29

Not the answer you're looking for? Browse other questions tagged .