Need to run a .sh as root on boot or login
Posted
by
Graymayre
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Graymayre
Published on 2013-01-19T21:34:41Z
Indexed on
2013/10/21
22:04 UTC
Read the original article
Hit count: 284
Still new with linux and running ubuntu 12.10
I have a wireless stick (ae2500) which has known issues that has been partially solved using ndiswrapper. However, to use it I must run the same scripts every time I reboot, effectively uninstalling and reinstalling the driver. I made a .sh file to run every time to make it easy, but I must do the sudo login everytime.
There are three solutions I am looking for and although not all are necessary to solve this particular problem, I would still like to know them all for learning purposes.
- run scripts or file.sh on boot (as well as other programs)
- run scripts or file.sh automatically with root privileges
- make the install permanent so as not to have to go through the process every time.
Any additional information that can help me regarding this that I did not think to ask (including streamlining my commands), or general knowledge, would be greatly appreciated. Following are the contents of the file. I pretty much just made it as I would have entered it.
cd ~/ndiswrapper-1.58rc1
sudo modprobe -rf ndiswrapper
sudo rm /etc/modprobe.d/ndiswrapper.conf
sudo rm -r /etc/ndiswrapper/*
sudo depmod -a
sudo make uninstall
sudo make
sudo make install
sudo ndiswrapper -i bcmwlhigh5.inf
ndiswrapper -l
sudo modprobe ndiswrapper
© Ask Ubuntu or respective owner